I don't know if this has been requested before, but it would be nice to have an backup feature like in WP. With my own site I put the ZP tables in the same databasa as WP. This way the WP backup utility backs up all my WP and ZP tables, once a day, and emails it to my gmail address. I will never forget to make a backup
.
A friend of mine is now using ZP as a blog. Several times I ask him if he made a backup recently, but most of the time he just forgets. Could the backup feature be made like the one in WP?
Comments
Anyone wishing to implement a CRON automatic backup would be a big help for us. The approach is to create a PHP script for CRON to run.
Here is the code (untested). It assumes that the script is in a folder named `CRON` which is in the root of the Zenphoto installation. (The actual folder name is not important.)
`
<?php
define('OFFSET_PATH',1);
define('KEEP',5); // the number of backups to maintain
require_once(dirname(dirname(__FILE__)).'/zp-core/functions.php');
$curdir = getcwd();
chdir(SERVERPATH . "/" . BACKUPFOLDER);
$filelist = safe_glob('*'.'.zdb');
$list = array();
foreach($filelist as $file) {
$list[$file] = filemtime($file);
}
chdir($curdir);
asort($list);
$list = array_flip($list);
while (count($list) >= KEEP) {
$file = array_shift($list);
unlink(SERVERPATH . "/" . BACKUPFOLDER.'/'.$file);
}
cron_starter( SERVERPATH.'/'.ZENFOLDER.'/'.UTILITIES_FOLDER.'/backup_restore.php',
array('backup'=>1, 'compress'=>sprintf('%u',getOption('backup_compression')),'XSRFTag'=>'backup'),
true
);
?>
`
Please add the instructions for the CRON job if you do get this going.