GNU/Linux Desktop Survival Guide
by Graham Williams |
|||||
Synchronise Directories |
20200124 To synchronise a local directory to a remote backup of that directory use the rsync command.
$ rsync -avzh local/ rhost:BACKUP/local/ |
To ignore any file/directory named cache:
$ rsync -avzh --exclude 'cache' local/ rhost:BACKUP/local/ |
To ignore backup files, for example:
$ rsync -avzh --exclude '*~' local/ rhost:BACKUP/local/ |
To remove any remote files that are not in the current source directory
use --delete
:
$ rsync -avzh --delete local/ rhost:BACKUP/local/ |