Created
October 22, 2013 04:38
-
-
Save ryanzabcik/7095308 to your computer and use it in GitHub Desktop.
This is the backup script designed to run every week on tachyon.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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