Web design, programming, graphics, and pretty much anything else I care about.

Using rsync

Rsync can be tricky, but it is the best way to synchronize the contents of directories. It is used when you don't want to simply delete one directory and replace it with another. For example, when replacing the contents of a directory under SVN version control you don't want the .svn directory to get removed or modified.

rsync -arvz [source] [destination]

-a "archive mode" which preserves links, permissions, etc.
-r recursive
-v verbose, multiple Vs increase the amount of data displayed. -vv, -vvv -vvvv.
-z compress
-n Do a dry-run, to see what would happen.
--exclude=[pattern] provide a pattern of files to ignore.

Be careful with the slashes after the source and destination directories. If slashes are not added at the end, it will compare the source directory to contents of the destination directory. This usually results in it copying the source directory into the destination directory. Adding slashes at the end of both will tell rsync to compare the contents of each.