From 44099a6a6bb014811c0f2e30d243c036c1c8cdfb Mon Sep 17 00:00:00 2001 From: doktornotor Date: Sat, 8 Aug 2015 16:40:06 +0200 Subject: 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. --- config/backup/backup.inc | 45 ++++++--------------------------------------- 1 file changed, 6 insertions(+), 39 deletions(-) (limited to 'config/backup') 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 @@ 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(); - } ?> -- cgit v1.2.3