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
I don't mind being notified about things that aren't problems, but I want there to be some information not just "your scheduled task has been run." If it's giving me a copy of the database (which I have one of my jobs set to do), the email is fine...but "it worked" would get annoying to see on a routine basis.

Oh, on the line that tells it to email you the database, is there a way to specify a subject? I'm using gmail and it'd be nice to be able to have it take all of the backups and put them together (via a label) and then archive them so I never get bothered with notifications about unread messages just to have the backup sitting there.
any chance this could be used so the backup name could contain a date variable?

aka so it could allow multiple daily backups


like one of my friends had used

[name removed]-07-03-10.sql.gz for example
(2010-03-19, 10:31 AM)Redeemed_warrior Wrote: [ -> ]any chance this could be used so the backup name could contain a date variable?
(2010-01-06, 03:45 AM)KuJoe Wrote: [ -> ]Yes. At the top of your script put:
NOW="$(date +"%m%d%Y")"

And for your backup name:
/MY/BACKUP/LOCATION/BACKUPNAME_$NOW.sql.gz

Like that?
(2010-03-19, 10:34 AM)ladyunicornejg Wrote: [ -> ]
(2010-03-19, 10:31 AM)Redeemed_warrior Wrote: [ -> ]any chance this could be used so the backup name could contain a date variable?
(2010-01-06, 03:45 AM)KuJoe Wrote: [ -> ]Yes. At the top of your script put:
NOW="$(date +"%m%d%Y")"

And for your backup name:
/MY/BACKUP/LOCATION/BACKUPNAME_$NOW.sql.gz

Like that?
Thank you! I somehow missed that post
What type of file do I save this as?
just as "file" no file extension I believe.
(2010-04-05, 08:47 PM)tommykent1210 Wrote: [ -> ]What type of file do I save this as?
(2010-04-05, 08:55 PM)Prentice Wrote: [ -> ]just as "file" no file extension I believe.

Yep, remove the extensions entirely. Smile
I do this straight from the ACP. Am I missing something or is it the same thing?
Can you make the backupdb.php file run and backup the ENTIRE database not just the mybb tables?
(2010-04-06, 12:31 AM)RPicard Wrote: [ -> ]I do this straight from the ACP. Am I missing something or is it the same thing?
Nope. Please read the first post in this thread.

(2010-04-06, 08:17 AM)tommykent1210 Wrote: [ -> ]Can you make the backupdb.php file run and backup the ENTIRE database not just the mybb tables?
Yes you can.
Pages: 1 2 3 4 5 6 7 8 9