Created
July 13, 2011 23:59
-
-
Save morganp/1081604 to your computer and use it in GitHub Desktop.
Disk level Back up script
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/bash | |
# Disk level Back up script | |
ARCHIVE_SERVER="192.168.0.30" | |
# Back up drive to target drive on server | |
disk[0]="/Volumes/Terra03/ $ARCHIVE_SERVER:/mnt/kryten/disk1/tank" | |
disk[1]="/Volumes/Terra04/ $ARCHIVE_SERVER:/mnt/kryten/disk2/tank" | |
disk[2]="/Volumes/Terra05/ $ARCHIVE_SERVER:/mnt/kryten/disk3/tank" | |
for backup in "${disk[@]}" | |
do | |
#Split in to $1 and $2 | |
set -- $backup | |
if [ -d $1 ] | |
then | |
rsync_with_options="rsync -av --ignore-errors --delete --exclude '.fseventsd' --exclude '.Trashes' --exclude '.Spotlight-V100' --exclude '.DS_Store' " | |
echo $rsync_with_options $1 $2 | |
rsync -av --ignore-errors --delete --exclude '.fseventsd' --exclude '.Trashes' --exclude '.Spotlight-V100' --exclude '.DS_Store' $1 $2 | |
else | |
echo "Drive offline $1 (Not Backed Up)" | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment