so.... If you want to get something - do it yourself
here is my modifications to the file admin\zip.php. I remove directories controls (to obtain all files)
and add filter by file name mask just before command to pack file into backup.
My knowlege of PHP is slightly greater than zero, so code is ugly, but its work right as I need.
Can anybody write this more clearly?
It seems to me that directories (internal GS and users external like my uploads) included into backup must be defined like GSROOTPATH somewhere in gsconfig.php to be an universal solution.
here is my modifications to the file admin\zip.php. I remove directories controls (to obtain all files)
Code:
foreach($iter as $element) {
/* @var $element SplFileInfo */
$dir = str_replace($sourcePath, '', $element->getPath()) . '/';
//------------- zencoder 2012.05.27 - backup selected directories only -------------
//if (strstr($dir,$GSADMIN.DIRECTORY_SEPARATOR) || strstr($dir,'backups'.DIRECTORY_SEPARATOR)) {
// #don't archive these folders
//} else if ($element->getFilename() != '..') { // FIX: if added to ignore parent directories
if ($element->getFilename() != '..') { // FIX: if added to ignore parent directories
// ------------- zencoder 2012.05.27 - backup selected directories only -------------
Code:
// add file to archive
// ------------- zencoder 2012.05.27 - backup selected directories only -------------
// http://get-simple.info/wiki/how_to:backup_website?s[]=backup
if (
strpos($file, 'data'.DIRECTORY_SEPARATOR ) == strlen(GSROOTPATH) ||
strpos($file, 'admin'.DIRECTORY_SEPARATOR ) == strlen(GSROOTPATH) ||
strpos($file, 'theme'.DIRECTORY_SEPARATOR ) == strlen(GSROOTPATH) ||
strpos($file, 'plugins'.DIRECTORY_SEPARATOR ) == strlen(GSROOTPATH) ||
// this is my folder outside GS which I want to be included into backup
strpos($file, 'uploads'.DIRECTORY_SEPARATOR ) == strlen(GSROOTPATH)
)
// ------------- zencoder 2012.05.27 - backup selected directories only -------------
$archiv->addFile($file, $fileInArchiv);
My knowlege of PHP is slightly greater than zero, so code is ugly, but its work right as I need.
Can anybody write this more clearly?
It seems to me that directories (internal GS and users external like my uploads) included into backup must be defined like GSROOTPATH somewhere in gsconfig.php to be an universal solution.