The following one liner can create a bzip2 archive of the mysql dump:
mysqldump -u$USER -p$PWD $DBNAME | bzip2 -c > $DBNAME.tar.bz2
Or use the following for a time stamped backup:
#mysqldump -u$USER -p$PWD $DBNAME | bzip2 -c > $DBNAME_$(date -d "today" +"%Y_%m_%d_%H%M").tar.bz2
Joel G Mathew, known in tech circles by the pseudonym Droidzone, is an opensource and programming enthusiast.
His favorite pastime is grappling with GNU compilers, discovering newer Linux secrets, writing scripts, hacking roms, and programs (nothing illegal), reading, blogging. and testing out the latest gadgets.
When away from the tech world, Dr Joel G. Mathew is a practising ENT Surgeon, busy with surgeries and clinical practise.