MyBB Community Forums

Full Version: HOW TO: Automated database backups (1 line of code + cPanel)
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4 5 6 7 8 9
You can setup WHM to do Daily, Weekly, and/or Monthly backups but not in cPanel to my knowledge. Keep in mind that this tutorial is only for the database and not a full backup like WHM does. The reason this is nice is because you can customize the frequency. All of my forum databases are backed up every 4 hours versus my full backups which only run once a day. Wink
has anyone encounter having a blank zip file? thanks
Nope, can you post your code (without your login information of course). Wink
How much is the Attached DB Height for use here?

And, how can I add the Gzip to the 9 level?

And if I want multiple backups, how can I use a ID for each backup?

Thanks.
(2009-11-07, 05:04 AM)Rafael Wrote: [ -> ]How much is the Attached DB Height for use here?

And, how can I add the Gzip to the 9 level?

And if I want multiple backups, how can I use a ID for each backup?

Thanks.

I'm not sure what you mean by "Attached DB Height", can you rephrase your question?

You can adjust the gzip compression just add -n after gzip (1 being lowest, 6 being default, and 9 being max). So the command would be:
/usr/bin/mysqldump -hDBHOST -uDBLOGIN -pDBPASSWORD DATABASE | gzip -9 > /MY/BACKUP/LOCATION/BACKUPNAME.sql.gz

For multiple backups, what I do is I timestamp the backups with the current date (or if you want multiple backups a day you can use the time also). I don't have the full command off hand since I'm at work, but once I get to class in the morning I will post the new code I use.
Sorry I didn't reply to this sooner, sleep got the best of me. Anyways, here's the current script that I run for one of my databases:

NOW="$(date +"%m%d%Y")"
mysqldump -hDBHOST -uDBLOGIN -pDBPASSWORD DATABASE | gzip > /MY/BACKUP/$NOW/BACKUPNAME.sql.gz
(2009-11-09, 11:42 AM)KuJoe Wrote: [ -> ]Sorry I didn't reply to this sooner, sleep got the best of me. Anyways, here's the current script that I run for one of my databases:

NOW="$(date +"%m%d%Y")"
mysqldump -hDBHOST -uDBLOGIN -pDBPASSWORD DATABASE | gzip > /MY/BACKUP/$NOW/BACKUPNAME.sql.gz

Good Thanks Smile

And, for the Email, I mean, E-mail the backup, well the DB Backup is sent you by email as a attachment right? so, wich is the most higher size of the DB to sent it as a Attachment? 10 Mb?
The attachment size depends on your database size. I have databases that range from 100KB-1GB (compressed).
(2009-11-10, 04:11 AM)KuJoe Wrote: [ -> ]The attachment size depends on your database size. I have databases that range from 100KB-1GB (compressed).

And is no limit for the Attachment size?
(2009-11-10, 12:44 PM)Rafael Wrote: [ -> ]
(2009-11-10, 04:11 AM)KuJoe Wrote: [ -> ]The attachment size depends on your database size. I have databases that range from 100KB-1GB (compressed).

And is no limit for the Attachment size?

The limit is based on your server/e-mail settings.
Pages: 1 2 3 4 5 6 7 8 9