Wednesday, October 24, 2018

Using Rsync to backup to an external drive

https://serverfault.com/questions/25329/using-rsync-to-backup-to-an-external-drive

use rsync with the following flags handily memorable as 'glop' and 'trunc' and 'v'.
rsync -gloptrunc $srcdir $dstdir
A brief guide:
  • g - preserve group ownership info
  • l - copy symlinks as symlinks
  • o - preserve owner info
  • p - preserve permissions
  • t - preserve timestamps
  • r - recurse thru directories
  • u - update, skip any newer files
  • [n] - no, dont do this, do a dry run instead
  • c - checksum, attempt checksums on file blocks when possible (*)
    note: on local filesystems, this get overridden and entire files are copied instead.
  • v - verbose
Compatible with FAT32:  rsync -rtv src dst