Saturday, January 06, 2007

rsync

Syntax:
rsync -vaHx --progress --numeric-ids --delete \
--exclude-from=asylum_backup.excludes --delete-excluded \
username@host:/home/userdir/ /backupdir/
Common options:
-v: verbose
-r: recursive
-a: archive - maintain perms, ownership
-H: Maintain hard links
-x: no recursion into other filesystems
--progress: shows progress info
--numeric-ids: don't translate UID/GIDs; important for backups.
--delete: delete from backup files that no longer exist on server
--exclude-from=file.txt: specifies a file to exclude paths. One path per line.
--delete-excluded: delete files previous backup which are now within exclude list
username@: username on remote host
host:: name of host
/home/userdir: path to backup
    trailing slash: backup contents of dir
no trailing slash: backup dir
/backupdir: location to backup files

Example of simple copy:
rsync -r -e ssh --delete /home/user/ user@host:/backups/


http://www.sanitarium.net/golug/rsync_backups.html
http://linuxgazette.net/104/odonovan.html

No comments: