Thread Rating:
  • 6 Vote(s) - 4.33 Average
  • 1
  • 2
  • 3
  • 4
  • 5
HOW TO: Automated database backups (1 line of code + cPanel)
#31
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
-Joe
AFreeCloud - Free Cloud-Based Web Hosting!
Reply
#32
has anyone encounter having a blank zip file? thanks
<signature too big>
Reply
#33
Nope, can you post your code (without your login information of course). Wink
-Joe
AFreeCloud - Free Cloud-Based Web Hosting!
Reply
#34
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.
vBulletin/Wordpress/Magento/MyBB
Developer and Designer
Reply
#35
(11-07-2009, 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.
-Joe
AFreeCloud - Free Cloud-Based Web Hosting!
Reply
#36
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
-Joe
AFreeCloud - Free Cloud-Based Web Hosting!
Reply
#37
(11-09-2009, 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?
vBulletin/Wordpress/Magento/MyBB
Developer and Designer
Reply
#38
The attachment size depends on your database size. I have databases that range from 100KB-1GB (compressed).
-Joe
AFreeCloud - Free Cloud-Based Web Hosting!
Reply
#39
(11-10-2009, 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?
vBulletin/Wordpress/Magento/MyBB
Developer and Designer
Reply
#40
(11-10-2009, 12:44 PM)Rafael Wrote:
(11-10-2009, 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.
-Joe
AFreeCloud - Free Cloud-Based Web Hosting!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)