Automated backup
Since August 18, my software development work has been picking up its pace and I have checked in more works more often, at least five times on single productive day. Ever since, I have been manually backing up Subversion directory using tar. My project server is fornax.
Fornax is a 6-year old PC running Ubuntu. It wasn’t working properly due to the cooling fan in its power supply unit. Until about two weeks ago, I replaced the old fan. I am not very confident about the replacement because it is a third party part and the replacement isn’t as good as expected, but it works. I have to shut it down every night before going to bed.
So, the last thing before I go to bed is to backup the svn directory and then shutdown the server. I am quite fed up with this extra manual works. Last night, before going to bed, I decided to automate this process. And I did it this morning.
I wrote a simple bash shell script to do the backup. I cron it so that the process will start automatically at 2300 hours and then shutdown.
#!/bin/bash
BACKUPFILE=/tmp/backups/svn-$(date +%Y%m%d).tar.gz
rm /tmp/backups/svn-*.gz
tar -cj /svn > $BACKUPFILE
for COMPUTER in host1 host2
do
scp $BACKUPFILE user@$COMPUTER:Desktop/
done
/sbin/shutdown -h +5
UPDATE (05/10/2009): I setup a password-less ssh login so that no password is required for scp (secured copy). Now, after the backup, the backup file will be copied automatically to two other computers for safe keeping.
95 RON sucks!
The new petrol, 95 RON, which was introduced on September 1 really sucks! Not powerful, not quieter and not economical at all. I still prefer 97 RON.
Making my dad proud
Perhaps this is the most difficult post ever for me to write. A mixture of emotion makes it even harder to start and it is impossible to write this post without shedding tears and touching emotion.
佛学 佛教 地藏经 太极 般若 诗 Ada algorithm Apple AWS behavior bread bread maker Buddhism cataract cataract surgery chinese input Christmas DAP Debian diagnosis earthquake emergency encryption Family Flywheel Food fracture free sparring Gifts gnat GPS Health heart holiday Honda HOWTO information Injuries input method iPhone iPod Touch iTunes jiyu kumite Karate karate-do kata KazeServer kumite Lamport laser retinopexy Leopard Linux Mac MacBook Mac OS X Malacca Malaysia Martial Arts Medical melaka MMU mysql Okinawa Olympic 2008 Penang Philosophy Photography pneumatic retinopexy Politics posterior vitreous detachment Princess psychology PVD recycle Research retina retina detachment retina repair retina tear Sanchin scholarship science scim Security Sichuan sparring Sports SSH stroke Subversion tongue training Ubuntu vitrectomy Wenchuan wholemeal wordpress Xcode Zakimi
WP Cumulus Flash tag cloud by Roy Tanck and Luke Morton requires Flash Player 9 or better.


Listen to my podcast