Browsing the blog archives for February, 2009

Bash script to backup mysql database

This is the first bash script I wrote, I used crontab to periodically backup and compress a mysqldb in a shared hosting environment

#!/bin/sh
user=testdbuser
password=testdb
dbname=testdb
location=~/db_backups
ts=$(date ‘+%Y%m%d-%H%M’)

mysqldump -u$user -p$password –opt $dbname > $location/temp-$ts.sql
cd $location
tar -cvzf $dbname-db-$ts.tar.gz temp-$ts.sql
rm -f temp-$ts.sql

0 Comments

5 ways to pissed off your teammates

These are all speaking through experience

Stubbornly kept on using deprecated code knowing that it will be remove from the code base in the next version, thereby hindering a smooth transition.
Violating all of the company’s coding and naming standards making things difficult to trace for bugs when you go on leave all of a sudden!
You raise [...]

0 Comments