Rsync

"-a stands for archive mode. It is a catch-all switch that turns on a variety of things in rsync, most of which I don't understand. I use all of these switches because Carla Schroder told me to. For more (or less) clarity, check out the man page for rsync." The rsync flag –copy-dirlinks does the magic by expanding all symlinks and copying the files. rsync -av --include projects --include projects/newprogram --include 'projects/newprogram/**' --exclude 'projects/**' --exclude '**' /home/skaperen/programs/. skaperen@backupserver:/home/skaperen/programs "This copies '/home/skaperen/programs/projects/newprogram' and all its subdirectories. The order of the --include and --exclude options is important to rsync. It checks each file to be considered against these options in order and applies the first match. This will create '/home/skaperen/programs' in the target if it does not exist. Ending the source path with '/.' ensures that if the target directory already exists, another directory called 'programs' will not be created in it (which would end up with '/home/skaperen/programs/programs' with a duplicate of everything). The subdirectories 'projects' and 'projects/newprogram' will be created as recursive subdirectories."
 * http://www.insidesocal.com/click/applications/rsync/
 * http://www.fredshack.com/docs/rsync.html
 * http://justaddwater.dk/2009/10/15/resolve-symlinks-when-copying-files-with-rsync/
 * http://www.unix.com/unix-advanced-expert-users/122048-rsync-creating-dirs-remote-server.html