Database backup

I have created a script that backs up my whole cs-cart, then ftp's a copy to a another server at my house. This is started each night as a cron job. The resulting backup is about 800meg.

So i was thinking that most files stay the same, its the database that changes. So how can I backup the database via a script. And is the resulting file, the same as if I do it from the admin section?

Or would then run my first script maybe weekly and the database backup daily.

This would eliminate one more thing, that i have to remeber to do each day.



mysqldump -u -p | gzip > .sql.gz

Thanks for the quick responce tbirnseth,

Now if I can ask. Is this the same as the cs-cart admin does it? So I could my script just place it in the standard cscart backup directory. and use the admin to restore from it?

Thanks again,


It is all “sql” format. Easiest way is to not gzip it since I don't remember what compression format they assume.