Permalink
Browse files

Add verbose info

  • Loading branch information...
1 parent 91ff30b commit 4805adaa25c092a3e4305c2e8db8ebc341b890c0 @ccesario committed Aug 14, 2012
Showing with 8 additions and 7 deletions.
  1. +8 −7 pfsensebkp/pfsensebkp.php
@@ -124,7 +124,7 @@ function printMessage($message)
// gets the data from a URL
-function do_backup($configHost = array())
+function createBackup($configHost = array())
{
global $debugprocess;
@@ -327,17 +327,18 @@ function do_backup($configHost = array())
$backupdir = $globalcfg['backupdir'].'/'.$hostcfg['hostname'];
checkPaths($backupdir);
- $x = do_backup($hostcfg);
+ $backup = createBackup($hostcfg);
- if (!$x['error']) {
+ if (!$backup['error']) {
$fp = fopen($backupdir.'/'.$hostcfg['address'].'-'.date("YmdHis").'.xml', 'w');
- fwrite($fp, $x['backup']);
+ fwrite($fp, $backup['backup']);
fclose($fp);
- createLog("SUCESS: ${hostcfg['hostname']} - ${hostcfg['address']}",$globalcfg['logdir']);
+ echo "SUCESS: ${hostcfg['hostname']} \t- ${hostcfg['address']} - ${backupdir}\n";
+ createLog("SUCESS: ${hostcfg['hostname']} - ${hostcfg['address']} - ${backupdir}",$globalcfg['logdir']);
}
else {
- echo $x['error'];
- createLog("${x['error']}",$globalcfg['logdir']);
+ echo "${backup['error']} - ${backupdir}\n";
+ createLog("${backup['error']}",$globalcfg['logdir']);
}
}
}

0 comments on commit 4805ada

Please sign in to comment.