Hi All,
I'd like to run a nightly site backup. I can achieve this on the command line with a command like
/usr/bin/drush -y --root='/var/www/aegir/path-to-drupal' 'provision' 'backup' 'example.com'
However, the backup doesn't show up in the Aegir admin for this site (not surprisingly I guess given that I did the backup from the command line).
The question is then - how can I achieve this? Backup on the command line or otherwise nightly and be able to restore from the Aegir admin. Is there a way to schedule backups in Aegir?
One way would be write a Perl script and use WWW::Mechanize to simulate me going to the backup page and clicking backup, but that's pretty hacky... it would work for now though I guess.
Any ideas? Thanks.
Comments
Since nobody with more
Since nobody with more expertise has responded, I'll offer an idea.
Long shot: If you re-verify the site and the platform does it perchance find your manual backups?
Assuming no, I would start by reading the code for 'provision verify' and 'provision backup'. When a platform is verified it imports sites that the Aegir installation didn't previously know about. It would make sense to have the "verify site" code search for site backups that it didn't know about. You might be able to create a small patch to implement this. Of course if you are interested in your patch getting accepted, you probably should begin with a feature request in the Provision issue queue saying that you are interested in creating a patch. There's a good chance that Adrian and co have a plan for this down the road...
Let us know how it goes.
Please see this thread too
Please see this thread too for automated scheduled backups.
The reason a backup generated from the command line is not seen in the Restore tab in Aegir, is because it wasn't generated through the frontend.
When a backup is scheduled through the frontend, a row is written to the hosting_site_backups table. The backup references the site node id in the 'site' column, which is the magic that allows Restore to know what backups are related to that site, and hence are available.
When you run a backup from the commandline as opposed to through a task in the frontend of Aegir, there is no way to associate the backup with the site's node id, which in turn means it isn't something that can be written to the hosting_site_backups table, and hence it is not seen in the Restore tab :)
Such backups are still a good idea to make and can be restored manually using the 'provision restore' or deploy commands, from the commandline. You can never have too many backups, even if they can't be used in the frontend :)