-
Eddie IS.
January 9, 2008
|
| Popularity: 44% [?]
A failed server partition resize has blown away all my blog postings. Dammit! I thought I’d backed up everything, but I suppose it’s fathomable I might miss something that late at night.
Regardless, the server is running better than ever, but I think my next project I blog about will be a set of backup scripts….
See ya in a bit.
Popularity: 44% [?]
6 Comments »
RSS feed for comments on this post. TrackBack URI
Leave a comment


Speaking of losing stuff, I’m retyping this message because I forgot to enter my email address and it wiped the form when I went back.
Here is the abbreviated version:
1. I avoid partition resizes like the plague and assume they will wipe my data.
2. I had a cool shell script that did differential backups with rsync that I used to run as a cron job. Do you want me to dig it up or do you have another method in mind?
Comment by monjardin — January 9, 2008 #
Hey! Welcome back monjardin. Bittersweet irony you lose your comment on said post.
I’m with you on 1). Windows world it’s generally been OK, but Partition magic is much nicer to me than parted + reiserfs.
2) I’d love to take a look at your script. I’m actually thinking of tooling around with bash and building up a ‘plugin’ based backup system, but I’ve been reading up on differential backup systems and think I should incorporate that as well…
Let me know what you find out! And thanks for tuning back in.
Comment by eddie — January 14, 2008 #
#!/bin/bash
BACKUPDIR=/backup
EXCLUDES=$BACKUPDIR/backup_exclude
CURRENT=$BACKUPDIR/current
OLD=$BACKUPDIR/old
NOW=`date ‘+%Y-%m’-%d_%H:%M`
NOW=$OLD/$NOW
DAYS=60
# CREATE DIRECTORIES
mkdir -p $CURRENT
mkdir -p $OLD
mkdir $NOW
# RUN RSYNC INTO CURRENT
rsync -apvz –delete –delete-excluded –exclude-from=”$EXCLUDES” / $CURRENT
# UPDATE MTIME TO REFLECT THE SNAPSHOT TIME
touch $CURRENT
# MAKE HARDLINK COPY
cp -al $CURRENT/* $NOW
# REMOVE OLD BACKUPS
echo “Removing old backups…”
for FILE in “$( find $OLD -maxdepth 1 -type d -mtime +$DAYS )”
do
rm -Rf $FILE
done
exit 0
Comment by monjardin — January 14, 2008 #
It uses some hard-link trickery to ensure that it only makes differential backups while still retaining the ability to fully restore from any point.
Change the DAYS value to specify how long to keep old backups, and the BACKUPDIR value to where you want the backups to go. I had it going to a portable USB hard drive that I could lug around with me.
I can’t remember where I got this from, but it worked great for me. Just put it in a cron job like so:
0 0 * * * sh /your_path_here/backup.sh
…or run it whenever you wish.
Comment by monjardin — January 14, 2008 #
Interesting.
Is there a reason you didn’t look at something like rsnapshot?
Comment by eddie — January 14, 2008 #
Pingback by Tara and Eddie (dot) com — March 7, 2008 #