Rsync

From Things and Stuff Wiki
Revision as of 16:03, 3 September 2012 by Milk (talk | contribs)
Jump to navigation Jump to search


Backup#Rsync

Arch

#!/bin/sh

START=$(date +%s)
rsync -aAXv /* $1 --exclude= {/dev/*,/proc/*,/sys/*,/tmp/*,/run/*,/mnt/*,/media/*,/lost+found,/home/*/.gvfs,/var/lib/pacman/sync/*,/home/*/.thumbnails/*,/home/*/.mozilla/firefox/*.default/Cache/*,/home/*/.cache/chromium/*}
FINISH=$(date +%s)
echo "total time: $(( ($FINISH-$START) / 60 )) minutes, $(( ($FINISH-$START) % 60 )) seconds"

touch $1/"Backup from $(date '+%A, %d %B %Y, %T')"
-a, --archive               archive mode; equals -rlptgoD (no -H,-A,-X)
-r, --recursive             recurse into directories
-l, --links                 copy symlinks as symlinks
-p, --perms                 preserve permissions
-t, --times                 preserve modification times
-g, --group                 preserve group
-o, --owner                 preserve owner (super-user only)
-d, --dirs                  transfer directories without recursing
-D  --devices --specials.
-H, --hard-links            preserve hard links
-A, --acls                  preserve ACLs (implies -p, save permissions)
-X, --xattrs                preserve extended attributes
-v, --verbose               increase verbosity
    --stats                 give some file-transfer stats
-h, --human-readable        output numbers in a human-readable format
    --progress              show progress during transfer
    --inplace               update destination files in-place, good for cow, implies partial
    --delete-after          receiver deletes after transfer, not during


rsync -axv --stats --exclude-from=${EXLUDE_FILE} --delete-after /home/clockfort /mnt/clockfort/storage/backups/jolt-home
rsync -a --acls --xattrs --whole-file --numeric-ids --delete --delete-excluded --human-readable --inplace
rsync -aPv --delete --exclude downloads --exclude music --exclude .cache /home/nomaster/ /mnt/backup/nomaster/
--archive --stats --hard-links --partial  --delete --delete-excluded --numeric-ids --inplace -x --timeout 600"
-acSHXA --numeric-ids --del
--archive --sparse --partial --delete --delete-excluded
-av --numeric-ids --delete --delete-excluded --human-readable --inplace
rsync --delete --delete-before --delete-excluded --inplace \
   --no-whole-file -a $@ "$TMP_MOUNT"/ "$BACKUP_DIR"/cur
rsync --archive --one-file-system --hard-links --inplace --numeric-ids --progress --verbose --delete --delete-excluded --exclude=/self_backups

Debian