Auto Backup - how does it schedule

By weblm - October 22, 2010

With Auto Backup.....does it only actually run while you are logged in? In other words....if I have it set to do hourly backups.....will the hourly backups run if I'm not logged into the admin?

-Kevin
LM

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

By weblm - October 22, 2010

Ok, so on at least 2 installs.....it seems that the backup doesn't actually "auto" run. If I log out of the admin, 2 hours later, no hourly backups were run. However, once I login to the admin, an hourly backup is generated.

If this is the expected behavior.....is there a way to schedule this with cron at all?

-Kevin
LM

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

By weblm - October 22, 2010

Jason,

Ok thanks. So in other words, by being logged into the admin, it will run backups at hourly, daily, etc. But you have to be logged in and active for it to work?

-Kevin
LM

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

By Jason - October 22, 2010

Hi Kevin,

That's correct. The autobackup won't run in the background on the server. You'd have to create a cron job in order to do that.
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

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

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

By Chris - October 22, 2010 - edited: October 22, 2010

Actually, that's subtly incorrect:

You don't have to be logged in, but something has to hit admin.php periodically. Because of this, it is possible to set up one of the many [url http://www.google.com/search?q=web+cron]Web Cron[/url] services to hit your admin.php page, allowing Auto Backup to do its thing. You won't need to provide a username/password or anything. Also, Web Crons tend to be very easy to configure!

I hope this helps! Please let me know if you have any questions.
All the best,
Chris

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

By weblm - October 24, 2010

Chris,

Good to know thanks. So I can setup a cron on the server to simply load the admin.php page hourly, and the backup will run?

You know the syntax on cron to just load the admin.php page? Is it different than running a .sh script? Do I need to output the results to /dev/null?

-Kevin
LM

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

By weblm - October 24, 2010

Ok so I figured I can run:
/usr/local/bin/php -q ~/path/cmsAdmin/admin.php

(-q is suppose to supress the cron from emailing)

Haven't tested in cron yet, but it works from the command line.

Only issue so far is the backup files get filenames of:
no-hostname-v2.06-hourly-07.sql.php

Not sure if that matters or not.

-Kevin
LM

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

By weblm - October 24, 2010

Ok, so another followup, here's the command in cron that is working for me:

0 * * * * /usr/local/bin/php /path/cmsAdmin/admin.php >/dev/null 2>&1

My server didn't have the -q flag for php.
The >/dev/null 2>&1 will suppress email.

-Kevin
LM

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

By weblm - October 24, 2010

And finally....to finish this out....I found the variable in the backup script to enter the domain name:

$GLOBALS['AUTOBACKUP_DEFAULT_PREFIX'] = ''; // Backup file prefix, leave blank to use current domain name

So now my domain is in the filename.

-Kevin
LM