Jan
19
2010
rsync over ssh
Rysnc from 1 linux box to another and keep the file structure identical
Delete files from the target directory that have been deleted in the source directory
rsync -avz -e ssh --delete remoteuser@remotehost:/remote/dir/ /this/dir/
Note: the ending {/} is important if you don’t want to hose a directory.
Backup a website on a linux box to your windows machine
rsync reads “:” in a filepath as a remote directory, so if you’re trying to rsync to “c://” rsync will be confused. Instead of using windows syntax for filepaths, use the cygwin directory structure.
- Install cygwin to windows
- test rsync and ssh are installed by typing from within the cygwin terminal:
rsync --version
ssh -l username somedomain - create a directory in c://cygwin named backups or whatever you want to call it.
rsync -avz -e ssh --delete remoteuser@remotehost:/remote/dir/ /cygdrive/c/directorynameChange the directory drive to whatever it should be