Auto Backup - how does it schedule

Re: [chris] Auto Backup - how does it schedule

By aev - October 25, 2010

Is it possible to make "/cmsAdmin/lib/viewer_functions.php" trigger the Auto Backups (in the background of course)?

Then any normal site visit would trigger the backups..

-aev-

Re: [aev] Auto Backup - how does it schedule

By Chris - October 25, 2010

Hi aev,

I think this should be possible by changing this line in the plugin:

addAction('init_complete', 'autoBackup_updateBackups', null, 0);

...to:

autoBackup_updateBackups();

That might cause some extra strain on your server if you're getting a lot of visitors. Please let me know if that works for you.
All the best,
Chris

By weblm - October 25, 2010

Just a quick followup question....so loading the admin.php page will be the only time a backup is run by default?

If that's the case, then does it simply check to see what backup(s) it needs to do next?

For example, if I just installed it and have it backup hourly, daily, weekly, and monthly. I login to the CMS admin on monday morning.....it will perform one of each of those backups. If I'm in the CMS admin for the next 3 hours, it will have run 2 more hourly backups. Now, if I get out....and don't go back in until Wednesday morning, and I don't touch the admin...no other backups should have been created (assuming no one loaded admin.php)?

Then, on Wed...if I login, it will then create a new hourly backup and daily backup?

-Kevin
LM

By Chris - October 25, 2010

Hi Kevin,

Correct! :)
All the best,
Chris

Re: [chris] Auto Backup - how does it schedule

By aev - October 26, 2010

Hi Chris,

concerning server strain, wouldn't that be minimal even if CMSB is set to do hourly backups?

If we have 1000 pageviews/hour wouldn't that require only a simple 'if' check or something similar for 999 of those? And then pageview #1000 triggers the backup?

-aev-

By weblm - October 26, 2010

So I think essentially, my cron solution is basically useless. Because the auto backup script will be auto triggered to run, is the clients hasn't been in the admin for a few days, then minute they log in, it will "catch up" on creating an hourly and daily backup at a minimum.

The cron essentially makes backups of the same unchanged data.

Couple of questions/points:

1) I think someone should make it clear on the plugin page that this only runs when someone hits the admin.php page or is logged in. The term "auto" to me made it sound like something that is done behind the scenes on a schedule.

2) I know you guys don't have revisions yet, and I know they can be complicated to implement. However, do you think there is a way to modify the auto backup script to:

- be triggered to run anytime a "Save" button is pressed in the admin
- make a backup at the time a "Save" button is pressed
- set it only keep XX of these "Save" backups (like 20 or so), and just keep cycling them through.

The only reason I say this is because of my thought of a client working in the CMS for a while.

Let's say the client logs in at 9am. I'm doing hourly backups so at 9am an hourly is taken. Now the client then works for the next 45 minutes making changes. If they then make a mistake and wipe out an entry, they can't restore to the 9am backup because then they would lose 45 minutes worth of work. However, if we were doing the "Save" backups, they could restore from the last one.

Sure, it may slow down saves slightly....but if it's a configurable option, I know some clients would take that trade off to have a global revision type backup system.

Thoughts?

-Kevin
LM

By Jason - October 26, 2010

Hi,

aev:
You're correct. The plugin will check if a backup had already been made that hour and if it has, it won't overwrite it. So if you have a 1000 visits in an hour, the backup will only be triggered once.

Kevin:

Each "page" you view inside CMS Builder is first run through admin.php, so no matter where you go, you're executing that file. So the plugin in automatic in the sense that you don't have to use the manual backup function to produce a backup.
As for your second question, it would be possible for us to produce a plugin that would do what you're asking. If you're interested in this, please email consulting@interactivetools.com and we can get a quote for you.

Hope this helps.
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

By Dave - October 28, 2010

Hi Guys,

I just read this thread and I think there's some confusion even among our internal programmers. I wrote this plugin and it does in fact backup any time either admin.php is access or _any_ viewer page. So for a website with any traffic at all you'll get accurate backup time stamps.

And if you have 100 users hitting a website page in the same second only 1 of them will get a delay while the backup is being created. And... You'll only get a delay if it's a large database.

Hope that helps, let me know any additional questions and I'll be happy to answer them. Sorry for the confusion!
Dave Edis - Senior Developer
interactivetools.com

Re: [Dave] Auto Backup - how does it schedule

By weblm - October 28, 2010

Dave,

That's awesome! I just checked it out and it does work exactly like that. Any viewer page on the site will force it to run. Wow....to think I was going to do a cron just to load admin.php [;)]

This also explains why I had one site, seemly creating backups way more than only having the admin.php page load.

-Kevin
LM