sg_backup.php
19 lines
| 1 | <?php |
| 2 | require_once(dirname(__FILE__).'/../boot.php'); |
| 3 | require_once(SG_BACKUP_PATH.'SGBackup.php'); |
| 4 | |
| 5 | if ($id) { |
| 6 | $allActions = SGBackup::getRunningActions(); |
| 7 | if (count($allActions)) { // abort any other backup if there is an active action |
| 8 | die(); |
| 9 | } |
| 10 | |
| 11 | $b = new SGBackup(); |
| 12 | $b->setIsManual(false); |
| 13 | $options = $b->getScheduleParamsById($id); |
| 14 | |
| 15 | if ($options) { |
| 16 | $b->backup(json_decode($options['backup_options'], true)); |
| 17 | } |
| 18 | } |
| 19 |