Cronjob Database Backup Script

Thursday 11th November 2004 06:32:24 AM

cronjobsI discovered a great way to backup a whole database automatically. The answer is setting up a Cronjob command using the following code:

mysqldump --opt --user=theusername --password=thepassword thedatabase gzip > db_backup.gz

Simply replace theusername, thepassword, and thedatabase with your data. You can set the Cronjob to backup the database whenever you want.

I'm using this method over at free-image-hosting.biz and I've set it up to make a backup everyday at midnight. The backup file is placed on the server just before the public_html folder so that only those with access can download it.

It is also possible to send the file over email but I have not managed to get this working.

Got to love those Cronjobs ;-)

Posted by Piniyini

<< Toseef's blog is now Toseef.com   Toseef's Blog   Eid Mubarak >>

post comments feed1 comment       Ctrl + Enter to comment
<< Toseef's blog is now Toseef.com   Toseef's Blog   Eid Mubarak >>
Post a comment   Track comments
Search

Feeds (Subscribe via Google Reader)
blog posts feed Blog Posts
recent comments feed Recent Comments

Archives
July 2008
May 2008
April 2008
February 2008
January 2008
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
March 2006
February 2006
January 2006
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
December 2004
November 2004
September 2004
August 2004

Recent Comments
Check out my Blog Roll

Says thanks to the following poeple for recently leaving a comment ...

Sami
Wally1973
Mari
Thebrowngirl
Debbie
Sally Feser
Specs
No One
Sobi
Akanksha
Amir
Lost Bedouin
Piniyini
Ash
Smee