, ,

Copy from local file to remote server using rsync

$ rsync -av -P myapp.tar.gz martian@202.x.x.x:~  #Assuming this server was set to DISALLOW PASSWORD Login
$ rsync -r -v --progress -e ssh user@remote-system:/address/to/remote/file /home/user/
$ cd uploads
[devUser@webdev uploads]$ ls
files  images   tmp
[root@webdev uploads]$ rsync -arvh files/ devUser@hostname:/var/www/uploads/files/
$ cd uploads
[devUser@webdev uploads]$ rsync -arvh files/ devUser@staging.mywebapp.com:/var/www/mywebapp/uploads/files/
devUser@staging.mywebapp.com's password: ? <Just enter the password>

Using scp

$ scp -Cpvr mywebapp user1@mysite.com:~

How to compress a file

$ tar -cvzf mywebapp.tar.gz mywebapp/

How to uncompress a file

$ tar -xvzf mywebapp.tar.gz