aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordoktornotor <notordoktor@gmail.com>2015-08-08 16:40:06 +0200
committerdoktornotor <notordoktor@gmail.com>2015-08-08 16:40:06 +0200
commit44099a6a6bb014811c0f2e30d243c036c1c8cdfb (patch)
tree5315be3a49de30a35267105432999b4ef5996209
parent31806ea4ef87516dd4978c62359323da64f60189 (diff)
downloadpfsense-packages-44099a6a6bb014811c0f2e30d243c036c1c8cdfb.tar.gz
pfsense-packages-44099a6a6bb014811c0f2e30d243c036c1c8cdfb.tar.bz2
pfsense-packages-44099a6a6bb014811c0f2e30d243c036c1c8cdfb.zip
backup package - cleanup round two
- Fix copyright header - Removed unused byte_convert() function - Rename Get backup_sync_package_php() to backup_sync_package() and get rid of the original backup_sync_package() which only called the other one.
-rw-r--r--config/backup/backup.inc45
1 files changed, 6 insertions, 39 deletions
diff --git a/config/backup/backup.inc b/config/backup/backup.inc
index e395756a..1a5eeab1 100644
--- a/config/backup/backup.inc
+++ b/config/backup/backup.inc
@@ -1,14 +1,11 @@
<?php
-/* $Id$ */
-/*
-/* ========================================================================== */
/*
backup.inc
+ part of pfSense (https://www.pfSense.org/)
Copyright (C) 2008 Mark J Crane
+ Copyright (C) 2015 ESF, LLC
All rights reserved.
-*/
-/* ========================================================================== */
-/*
+
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
@@ -30,23 +27,7 @@
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*/
-
-
-if (!function_exists("byte_convert")) {
- function byte_convert( $bytes ) {
- if ($bytes <= 0) {
- return '0 Byte';
- }
-
- $convention = 1000; //[1000->10^x|1024->2^x]
- $s = array('B', 'kB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB');
- $e = floor(log($bytes, $convention));
- return round($bytes/pow($convention, $e), 2) . ' ' . $s[$e];
- }
-}
-
-function backup_sync_package_php() {
-
+function backup_sync_package() {
global $config;
if ($config['installedpackages']['backup']['config'] != "") {
conf_mount_rw();
@@ -65,26 +46,12 @@ function backup_sync_package_php() {
}
}
-function backup_sync_package() {
- global $config;
- backup_sync_package_php();
-}
-
-
function backup_install_command() {
-
- global $config;
conf_mount_rw();
-
- //create the backup directory
- if (!is_dir('/root/backup/')) {
- @mkdir("/root/backup/");
- }
-
+ // Create the backup directory
+ safe_mkdir("/root/backup/");
backup_sync_package();
-
conf_mount_ro();
-
}
?>