diff --git a/.gitignore b/.gitignore index 936a441..de3b1ef 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ html/bin/*.txt html/data/* +html/inc/paths.php install/conf.php diff --git a/html/inc/bu-common.php b/html/inc/bu-common.php index 29d14f7..c21a667 100644 --- a/html/inc/bu-common.php +++ b/html/inc/bu-common.php @@ -124,16 +124,10 @@ $fn_e = getFilename_out( $buid, $bu_test, true ); // create the output files with the ID in the first line - //exec("echo 'ID: $buid' > data/$fn_o"); - //exec("echo 'ID: $buid' > data/$fn_e"); - - //error_log("Attempt to create file $fn_e"); - - file_put_contents("data/$fn_o","ID: $buid"); + file_put_contents("data/$fn_o","ID: $buid"); file_put_contents("data/$fn_e","ID: $buid"); - if( !file_exists( "data/$fn_e" )){ - //file_put_contents( "/var/www/www-root/data/www/backup-commander/html/data/err_out.txt", "failed to create file $fn_e" ); + if( !file_exists( "data/$fn_e" )){ return "exec failed to create file $fn_e"; } diff --git a/html/inc/paths.php b/html/inc/paths.php index 084ccd7..bf7ab25 100644 --- a/html/inc/paths.php +++ b/html/inc/paths.php @@ -1,4 +1,10 @@ - + \ No newline at end of file diff --git a/install/conf-sample.php b/install/conf-sample.php index ab2c843..15a94df 100644 --- a/install/conf-sample.php +++ b/install/conf-sample.php @@ -12,5 +12,17 @@ */ //$path_website = "/var/www/html"; +/* + * The following array contains a list of variable names and values. Each one of these is added to + * inc/paths.php + * + * Work through each one and ammend them for your system. + */ +$runtime_paths = array( + ['g_database_path', 'data/data.db'], // the database path relative to the DocumentRoot + ['g_phpcli_path', '/usr/bin/php'] // the commandline php interpreter, used for running the backup process on a separate thread. + // the g_phpcli_path value will need root access to correctly run rsync +); + ?> diff --git a/install/install.php b/install/install.php index 3db3490..ddb08ad 100644 --- a/install/install.php +++ b/install/install.php @@ -31,5 +31,15 @@ copy( "$path_project/install/db/data.db", "$path_website/data/data.db" ); } +$str_paths = '"; +file_put_contents( "$path_website/inc/paths.php", $str_paths ); + ?>