Skip to content

Instantly share code, notes, and snippets.

@jwatney
Created October 12, 2012 03:53
Show Gist options
  • Select an option

  • Save jwatney/3877211 to your computer and use it in GitHub Desktop.

Select an option

Save jwatney/3877211 to your computer and use it in GitHub Desktop.
#!/bin/bash
log="$(mktemp)"
email="[email protected]"
mount /media/Backup &&
rsync -vax --delete --ignore-errors --log-file=$log /media/Data/ /media/Backup/ &&
umount /media/Backup &&
(cat $log | mail -s "[rsync] Mirror Data drive $(date)" $email) &&
rm $log
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment