Backup

Jan 24, 2009 15:11

My understanding of computers is, they are machines and machines fail from time to time. That's when you get a replacement for the machine. With computers that's not always easy, because computers hold lots of valuable information, especially in times of digital cameras. So that's why we have backups. In my computer I had a separate hard drive ( Read more... )

security, computer

Leave a comment

Comments 5

uthr January 25 2009, 04:06:27 UTC
That's really great man.

Reply


ext_85194 January 28 2009, 11:51:05 UTC
nice one, just a small addition: you should check wether the mount went ok, otherwise it might screw up your filesystem. maybe something like this:

CNT=1
while [ ! -d /$BACKUP_MOUNT/somedir ]
do
if [ $CNT -gt 3 ]
then
echo "ERROR: Could not mount Backup Volume $BACKUP_MOUNT."
exit -1
fi
mount $BACKUP_MOUNT
CNT=$(expr $CNT + 1)
sleep 10
done

Reply

ext_85194 January 28 2009, 11:51:54 UTC
and maybe do the same while unmounting ;)

Reply

jkow January 28 2009, 20:12:14 UTC
good idea.

Reply


ext_85194 January 28 2009, 11:59:56 UTC
And just as an inspiration, I did something like this, too. I know the fun is writing the script but here is my version, a bit more modular and actually I trust my system path ;)

Cronjob in cron.daily:

#!/bin/sh
#
# This script runs rsyncbackup cronjobs

NICE="/usr/bin/nice -n 15"
RSYNCBACKUP="/usr/local/bin/rsyncbackup.sh"
BACKUPSET="daily"

logger -t rsyncbackup[$$] "Starting backup set ${BACKUPSET}."
${NICE} /bin/sh ${RSYNCBACKUP} ${BACKUPSET}
logger -t rsyncbackup[$$] "Backup set ${BACKUPSET} finished."

And the actual backup script:

#!/bin/sh ( ... )

Reply


Leave a comment

Up