gen_add_audit_log(GEN_DB_DATA_BACKUP); $backup->download($backup->dest_dir, $backup->dest_file, $save_local); // will not return if successful } break; case 'backup_log': if (ini_get('max_execution_time') < 20000) { set_time_limit(20000); } $backup = new backup(); $backup->db_filename = 'log-' . $_SESSION['company'] . '-' . date('Ymd'); $backup->source_dir = DIR_FS_MY_FILES . $_SESSION['company'] . '/'; $backup->source_file = $backup->db_filename . '.sql'; $backup->dest_dir = DIR_FS_MY_FILES . 'backups/'; $backup->dest_file = $backup->db_filename . '.zip'; if (!($result = $backup->dump_db_table($db, TABLE_AUDIT_LOG, 'both'))) { break; } $backup->make_zip('file'); if (file_exists($backup->source_dir . $backup->source_file)) { unlink($backup->source_dir . $backup->source_file); } if (!$error) { gen_add_audit_log(GEN_AUDIT_DB_DATA_BACKUP); $backup->download($backup->dest_dir, $backup->dest_file, false); } break; case 'clean_log': $temp = gen_get_dates(date('Y-m-d')); $current_date = date('Y-m-d', mktime(0, 0, 0, $temp['ThisMonth'], 1, $temp['ThisYear'])); $result = $db->Execute("delete from " . TABLE_AUDIT_LOG . " where action_date < '" . $current_date . "'");