Skip to content

Instantly share code, notes, and snippets.

@ryanzabcik
Created October 22, 2013 04:38
Show Gist options
  • Save ryanzabcik/7095308 to your computer and use it in GitHub Desktop.
Save ryanzabcik/7095308 to your computer and use it in GitHub Desktop.
This is the backup script designed to run every week on tachyon.
#!/bin/sh
if [ ! $UID = 0 ]; then
echo -e '\e[31merror: this script needs to be run as root'
exit 1
else
# echo each command before executing to show progress
set -o xtrace
dd if=/dev/disk/by-label/win8 | gzip -c > /mnt/data0/Backup/win8.ntfs.gz
umount /mnt/arch-backup
dd if=/dev/disk/by-label/arch-backup | gzip -c > /mnt/data0/Backup/arch-backup.ext4.gz
mount /mnt/arch-backup
if mount | grep -q /mnt/data0-backup; then
rsync -aAX --delete /mnt/data0/ /mnt/data0-backup
fi
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment