0) { /* Do NOT remove the trailing space after / from $backup_cmd below!!! */ $backup_cmd = "/usr/bin/tar --create --verbose --gzip --file {$backup_path} --directory / "; foreach ($a_backup as $ent) { if ($ent['enabled'] == "true") { $backup_cmd .= htmlspecialchars($ent['path']) . ' '; } $i++; } system($backup_cmd); } session_cache_limiter('public'); $fd = fopen("{$backup_path}", "rb"); header("Content-Type: application/force-download"); header("Content-Type: binary/octet-stream"); header("Content-Type: application/download"); header("Content-Description: File Transfer"); header('Content-Disposition: attachment; filename="' . $backup_filename . '"'); header("Cache-Control: no-cache, must-revalidate"); header("Expires: Sat, 26 Jul 1997 05:00:00 GMT"); header("Content-Length: " . filesize($backup_path)); fpassthru($fd); conf_mount_ro(); exit; } } if ($_GET['a'] == "other") { if ($_GET['t'] == "restore") { // Extract the tgz file if (file_exists($backup_path)) { conf_mount_rw(); system("/usr/bin/tar -xpzC / -f {$backup_path}"); header("Location: backup.php?savemsg=Backup+has+been+restored."); } else { header("Location: backup.php?savemsg=Restore+failed.+Backup+file+not+found."); } conf_mount_ro(); exit; } } if (($_POST['submit'] == "Upload") && is_uploaded_file($_FILES['ulfile']['tmp_name'])) { conf_mount_rw(); move_uploaded_file($_FILES['ulfile']['tmp_name'], "{$backup_path}"); $savemsg = "Uploaded file to {$backup_dir}" . htmlentities($_FILES['ulfile']['name']); system("/usr/bin/tar -xpzC / -f {$backup_path}"); conf_mount_ro(); } $pgtitle = "Backup: Files & Directories"; include("head.inc"); ?>
Use this to tool to backup files and directories. The following directories are recommended for backup:
pfSense Config/cf/conf
RRD Graph Data Files/var/db/rrd


Upload and Restore
Use this to upload and restore your backup file. File to upload:


Backup / Restore
The 'Backup' button compresses the directories that are listed below to /root/backup/pfsense.bak.tgz; after that it presents the file for download.
If the backup file does not exist in /root/backup/pfsense.bak.tgz then the 'Restore' button will be hidden.


\n"; } ?>


0) { foreach ($a_backup as $ent) { ?>
Name Path Enabled Description