// Cleanup any temporary local destinations.
pb_backupbuddy::status('details', 'Cleaning up any temporary local destinations.');
foreach (pb_backupbuddy::$options['remote_destinations'] as $destination_id => $destination) {
    if ($destination['type'] == 'local' && (isset($destination['temporary']) && $destination['temporary'] === true)) {
        // If local and temporary.
        if (time() - $destination['created'] > $backup_age_limit) {
            // Older than 12 hours; clear out!
            pb_backupbuddy::status('details', 'Cleaned up stale local destination `' . $destination_id . '`.');
            unset(pb_backupbuddy::$options['remote_destinations'][$destination_id]);
            pb_backupbuddy::save();
        }
    }
}
// Cleanup excess remote sending stats.
pb_backupbuddy::status('details', 'Cleaning up remote send stats.');
backupbuddy_core::trim_remote_send_stats();
// Verify directory existance and anti-directory browsing is in place everywhere.
backupbuddy_core::verify_directories($skipTempGeneration = true);
require_once pb_backupbuddy::plugin_path() . '/classes/fileoptions.php';
// Mark any backups noted as in progress to timed out if taking too long. Send error email is scheduled and failed or timed out.
// Also, Purge fileoptions files without matching backup file in existance that are older than 30 days.
pb_backupbuddy::status('details', 'Cleaning up old backup fileoptions option files.');
$fileoptions_directory = backupbuddy_core::getLogDirectory() . 'fileoptions/';
$files = glob($fileoptions_directory . '*.txt');
if (!is_array($files)) {
    $files = array();
}
foreach ($files as $file) {
    pb_backupbuddy::status('details', 'Fileoptions instance #43.');
    $backup_options = new pb_backupbuddy_fileoptions($file, $read_only = false);
    if (true !== ($result = $backup_options->is_ok())) {
Esempio n. 2
0
// Cleanup any temporary local destinations.
pb_backupbuddy::status('details', 'Cleaning up any temporary local destinations.');
foreach (pb_backupbuddy::$options['remote_destinations'] as $destination_id => $destination) {
    if ($destination['type'] == 'local' && (isset($destination['temporary']) && $destination['temporary'] === true)) {
        // If local and temporary.
        if (time() - $destination['created'] > $backup_age_limit) {
            // Older than 12 hours; clear out!
            pb_backupbuddy::status('details', 'Cleaned up stale local destination `' . $destination_id . '`.');
            unset(pb_backupbuddy::$options['remote_destinations'][$destination_id]);
            pb_backupbuddy::save();
        }
    }
}
// Cleanup excess remote sending stats.
pb_backupbuddy::status('details', 'Cleaning up remote send stats.');
backupbuddy_core::trim_remote_send_stats($backup_age_limit);
// Verify directory existance and anti-directory browsing is in place everywhere.
backupbuddy_core::verify_directories($skipTempGeneration = true);
require_once pb_backupbuddy::plugin_path() . '/classes/fileoptions.php';
// Mark any backups noted as in progress to timed out if taking too long. Send error email is scheduled and failed or timed out.
// Also, Purge fileoptions files without matching backup file in existance that are older than 30 days.
pb_backupbuddy::status('details', 'Cleaning up old backup fileoptions option files.');
$fileoptions_directory = backupbuddy_core::getLogDirectory() . 'fileoptions/';
$files = glob($fileoptions_directory . '*.txt');
if (!is_array($files)) {
    $files = array();
}
foreach ($files as $file) {
    pb_backupbuddy::status('details', 'Fileoptions instance #43.');
    $backup_options = new pb_backupbuddy_fileoptions($file, $read_only = true);
    if (true !== ($result = $backup_options->is_ok())) {