Create directories and databases backup, upload it to local directory or to ftp and send notification email with detail statistics.
- PHP 5.3
- Unix OS
git clone git://github.com/AlexeyFreelancer/BackupTask.git
git clone git://github.com/symfony/ClassLoader.git
cp ./BackupTask/config.dist.php config.php
Change settings in config.php
Create new file backup.php with following code
<?php
require_once 'ClassLoader/ClassLoader.php';
use Symfony\Component\ClassLoader\ClassLoader;
$loader = new ClassLoader();
$loader->register();
$loader->addPrefix('BackupTask', '.');
$config = include 'config.php';
$backupTask = new BackupTask\BackupTask($config);
try {
$backupTask->run();
} catch (Exception $e) {
echo $e->getMessage();
}
@daily /usr/bin/php /path/to/backup.php daily
@weekly /usr/bin/php /path/to/backup.php weekly
@monthly /usr/bin/php /path/to/backup.php monthly