DB Backup Scheduler

https://www.phpbb.com/ideas/
User avatar
thecoalman
Community Team Member
Community Team Member
Posts: 2812
Joined: Wed Dec 22, 2004 3:52 am
Location: Pennsylvania, U.S.A.
Contact:

Re: DB Backup Scheduler

Post by thecoalman » Fri Feb 16, 2018 3:57 pm

Ger wrote:
Fri Feb 16, 2018 1:43 pm
Doesn't every descent host offer DB backups in the control panel? I can go back 7 days, that would suffice I'd say.
Unless you have control over when they are made and can download them as they are made I would not rely on that. I have a VPS and the server died once, when the server came back online the database backup they restored was three days older than when the server failed as was everything else. e.g. log files were missing 3 days and as another example files that been uploaded were missing. I had my own backups so it was no big deal.

Another hard lesson to avoid is the importance of having revisions. e.g. you accidentally set a forum to prune posts and never realize it for a lengthy period of time. If your oldest backup is after it was pruned you are toast.

The script I linked to above by default will make a daily backup for say Mon to Sat. It will delete the the backup from last Monday when a new week starts. On Sun. it will create a weekly backup in different folder, those are rotated out after 5 weeks. It also creates monthly backup, by default those are rotated out every 6 months but I keep them all.

In other words i have backup for each of the last 7 days, I have backup for each of the last 5 Sundays and I have a backup for the first of each month going back years.

That is jut the tip of the iceberg for that script. It does incremental backups, will encrypt the backup, email backups and i thin it will even upload them to offsite service etc. I have my FTP client scheduled to download them.

User avatar
Mick
Support Team Member
Support Team Member
Posts: 20366
Joined: Fri Aug 29, 2008 9:49 am
Location: Cardiff

Re: DB Backup Scheduler

Post by Mick » Fri Feb 16, 2018 7:04 pm

Mick wrote:
Mon Feb 12, 2018 10:37 am
You can backup the DB as much as you like . . .
But does it check them?
"The more connected we get the more alone we become" - Kyle Broflovski

There are no ‘threads’ in phpBB, they are topics.

User avatar
thecoalman
Community Team Member
Community Team Member
Posts: 2812
Joined: Wed Dec 22, 2004 3:52 am
Location: Pennsylvania, U.S.A.
Contact:

Re: DB Backup Scheduler

Post by thecoalman » Fri Feb 16, 2018 11:02 pm

Mick wrote:
Fri Feb 16, 2018 7:04 pm
But does it check them?
Are you asking me Mick? This is a bash script and commands are issued directly to MySQL, time out issues associated with PHP which is apparently the biggest issue for most people do not exist. My understanding is the possibility of this failing is slim, you would need a preexisting problem such as a crashed table, MySQL itself crashed etc..

It will email you copy of the log. Additionally I check the file sizes occasionally for consistency, they grow X amount of KB's per day under normal operation. About once a month the most recent backup is used to populate a database on my local machine.

Getting back to the topic at hand, as far as the PHP timeout issue for support questions if I suspect it might be incomplete database backup I always ask people to open the file and see if the last insert commands are for phpbb_zebra. Perhaps if a comment line was added like #end phpBBbackup you could then have cron.php grab the last line of the last backup to check for that line.

User avatar
Mick
Support Team Member
Support Team Member
Posts: 20366
Joined: Fri Aug 29, 2008 9:49 am
Location: Cardiff

Re: DB Backup Scheduler

Post by Mick » Sat Feb 17, 2018 10:30 am

thecoalman wrote:
Fri Feb 16, 2018 11:02 pm
the last insert commands are for phpbb_zebra. Perhaps if a comment line was added like #end phpBBbackup you could then have cron.php grab the last line of the last backup to check for that line
Now we’re talking!!
"The more connected we get the more alone we become" - Kyle Broflovski

There are no ‘threads’ in phpBB, they are topics.

User avatar
david63
Jr. Extension Validator
Posts: 15060
Joined: Thu Dec 19, 2002 8:08 am
Location: Lancashire, UK
Name: David Wood
Contact:

Re: DB Backup Scheduler

Post by david63 » Sat Feb 17, 2018 7:34 pm

Mick wrote:
Sat Feb 17, 2018 10:30 am
thecoalman wrote:
Fri Feb 16, 2018 11:02 pm
the last insert commands are for phpbb_zebra. Perhaps if a comment line was added like #end phpBBbackup you could then have cron.php grab the last line of the last backup to check for that line
Now we’re talking!!
But what would happen if an extension added another table after _zebra (unlikely I know but possible)?
David
Remember: You only know what you know and - you don't know what you don't know!
My CDB Contributions | How to install an extension
I will not be accepting translations for any of my extensions in Github - please post any translations in the appropriate topic.
No support requests via PM or email as they will be ignored

User avatar
canonknipser
Registered User
Posts: 1711
Joined: Thu Sep 08, 2011 4:16 am
Location: Germany
Name: Frank Jakobs
Contact:

Re: DB Backup Scheduler

Post by canonknipser » Sat Feb 17, 2018 7:42 pm

The #end-comment or similar would be save, I think - even for the worst case that tables are listed in the backup in another order - maybe in creation time order, so that extension tables or tables added by later releases will go to the end.

It's a very common praxis to have a start an a end line in files (and often the end line also contains control elements like sums or line counters) so the file can be checked to be complete.
Greetings, Frank
phpbb.de support team member
English is not my native language - no support via PM or mail
New arrival - Extensions and scripts for phpBB

Post Reply

Return to “phpBB Ideas”

Who is online

Users browsing this forum: No registered users and 5 guests