Backtrack:  
 
by lunarg on April 28th 2007, at 00:18

If you are blessed with ssh access to your webhosting, then a world of goodies opens up. One of these is rsync. When installed on your webhosting (which usually is), you can use this instead of ftp to maintain your website.

The power of rsync

Rsync is mainly used for syncing two file structures (directories and subdirectories) together. It works by comparing the two structures and check out each directory and files on modified date and time, but also content of the file (using hashes).
While mostly used for backup, this thingy is very handy when maintaining a website. Rather than figuring out which files need to be copied, rsync does it all for you with a single command.

Sync your website... (or anything you want)

rsync -e ssh -rltDv <local website>/* <user>@<address>:/<remote website>

Don't worry about all those parameters. The main idea is that it will connect to the remote server using ssh, then it will sync the files (using the ssh connection). It will also try to set the file and directory permissions correctly, but it won't tamper with the owner uid/gid settings of the files.