remote_bkp/0000777000000000000000000000000011302275477014104 5ustar adminadministratorsremote_bkp/inc/0000777000000000000000000000000011272333641014647 5ustar adminadministratorsremote_bkp/inc/cfg-remote_bkp.php0000766000000000000000000004121511327242320020242 0ustar adminadministratorswindow.location='$url_npkg&action=setup&npkg=$npkg';"; if ( !isset($_GET['new']) && !isset($_GET['edit']) ) { // NPKG Configuration page header $show_enable = true; $show_disable = true; $show_remove = true; include("npkg_head.php"); // **** RSYNCD **** // RSyncd processing if (isset($_POST['RSYNCD'])) { cgi_bin("npkg.cgi?action=$npkg&config=".$_POST['RR_SEVER_PORT']); // if (isset($_POST['USE_OF_RSYNC'])) exec(WRITE_HTTP."npkg/remote_bkp.cgi?remote=enable&port=".$_POST['RR_SEVER_PORT'].WRITE_HTTP_END); // else exec(WRITE_HTTP."npkg/remote_bkp.cgi?remote=disable".WRITE_HTTP_END); } // Rsyncd daemon configuration if (file_exists("$rootdir/.npkg/$npkg/inc/rsyncd.conf")) { // Read from rsyncd.conf if exists $ini_array = new ini_file("$rootdir/.npkg/$npkg/inc/rsyncd.conf"); $port = $ini_array->get("","port"); $rsyncd = "checked"; } else { $port = 873; $rsyncd = ""; } // Rsyncd web interface echo "
"._NPKG_REMOTE_TITLE."

"; /* // **** SCHEDULED JOBS **** // Delete job processing if (isset($_GET['delete'])) { $ini_array = new ini_file("$rootdir/.npkg/$npkg/inc/rsync_schedule.conf", true); $ini_array->remove("Schedule".$_GET['delete']); // Sort jobs $i = 0; foreach($ini_array->ini as $key=>$Section) if ($key != "Global") { if ($key != "Schedule$i") { $ini_array->ini["Schedule$i"] = $ini_array->ini[$key]; $ini_array->set("Schedule$i","ID",$i); unset($ini_array->ini[$key]); } $i++; } $ini_array->set("Global","Schedule Number",$i); $ini_array->save(); } // Read job list $ini_array = parse_ini_file("$rootdir/.npkg/$npkg/inc/rsync_schedule.conf", true); echo "UNDER IMPLEMENTATION

"._NPKG_JOB_CURRENT."

"; // *** JOB Web interface } else { $ini_array = new ini_file("$rootdir/.npkg/$npkg/inc/rsync_schedule.conf", true); // Init variable for new job $jobid = 0; foreach($ini_array->ini as $key=>$Section) if ($key != "Global") $jobid++; $NAME = ""; $SMB_LOCATION = ""; $RR_CLIENT_PORT = ""; $REMOTE_VOL = ""; $REMOTE_PATH = ""; $SMB_USERNAME = ""; $SMB_PASSWD = ""; $LOCAL_VOL = ""; $LOCAL_PATH = ""; $b_week = ""; $USE_OF_SSH = ""; $backup_type = ""; $b_day = ""; $TIME_HOUR = ""; $TIME_MIN = ""; $RR_SSH_PORT = ""; $COMPRESS = ""; $STOP_SERVICE = ""; $INCREMENTAL_COPY = ""; $REMOVE_EX_FILE = ""; $result = ""; $mode = "new"; // Save job processing if (isset($_POST['jobid'])) { $index = "Schedule".$_POST['jobid']; $ini_array->set($index,"ID",$_POST['jobid']); $ini_array->set($index,"Name",$_POST['NAME']); $ini_array->set($index,"Remote Volume",$_POST['REMOTE_VOL']); $ini_array->set($index,"Remote Path","/".$_POST['REMOTE_PATH']); $ini_array->set($index,"Local Volume",$_POST['LOCAL_VOL']); $ini_array->set($index,"Local Path","/".$_POST['LOCAL_PATH']); $ini_array->set($index,"Remote IP",$_POST['SMB_LOCATION']); $ini_array->set($index,"User Name",$_POST['SMB_USERNAME']); $ini_array->set($index,"Password",$_POST['SMB_PASSWD']); $ini_array->set($index,"Schedule Type",!isset($_POST['backup_type'])?0:$_POST['backup_type']); $ini_array->set($index,"Week",!isset($_POST['b_day'])?0:$_POST['b_day']); $ini_array->set($index,"Month",!isset($_POST['b_week'])?0:$_POST['b_week']); $ini_array->set($index,"Hour",!isset($_POST['TIME_HOUR'])?0:$_POST['TIME_HOUR']); $ini_array->set($index,"Minute",!isset($_POST['TIME_MIN'])?0:$_POST['TIME_MIN']); $ini_array->set($index,"Compressed",isset($_POST['COMPRESS'])?"True":"False"); $ini_array->set($index,"Incremental",isset($_POST['INCREMENTAL_COPY'])?"True":"False"); $ini_array->set($index,"Delete Extra",isset($_POST['REMOVE_EX_FILE'])?"True":"False"); $ini_array->set($index,"Stop Net",isset($_POST['STOP_SERVICE'])?"True":"False"); $ini_array->set($index,"Use of SSH",isset($_POST['USE_OF_SSH'])?"True":"False"); $ini_array->set($index,"SSH PORT",isset($_POST['RR_SSH_PORT'])?$_POST['RR_SSH_PORT']:""); $ini_array->set($index,"RSYNC MODE",$_POST['RR_CLIENT_MODE']); $ini_array->set($index,"RSYNC PORT",$_POST['RR_CLIENT_PORT']); $ini_array->set($index,"Status",""); $ini_array->set($index,"Finished Time",""); $ini_array->set("Global","Schedule Number",$_POST['jobid']+1); // Test or Save if ($_POST['test'] == 1) { $ini_array = new ini_file("$rootdir/.npkg/$npkg/inc/rsyncd.conf"); $port = $ini_array->get("","port"); if (trim($_POST['LOCAL_PATH']) == "/") $RR_local_path = $_POST['LOCAL_VOL']; else $RR_local_path = $_POST['LOCAL_VOL']."/".$_POST['LOCAL_PATH']; if (trim($_POST['REMOTE_PATH']) == "/") $RR_remote_path = $_POST['REMOTE_VOL']; else $RR_remote_path = $_POST['REMOTE_VOL']."/".$_POST['REMOTE_PATH']; echo "test=$port&".$_POST['SMB_USERNAME']."=".$_POST['SMB_PASSWD']."&local=$RR_local_path&".$_POST['SMB_LOCATION']."=$RR_remote_path"; //exec(WRITE_HTTP."npkg/remote_bkp.cgi?test=$port&".$_POST['SMB_USERNAME']."=".$_POST['SMB_PASSWD']."&local=$RR_local_path&".$_POST['SMB_LOCATION']."=$RR_remote_path".WRITE_HTTP_END); echo "TEST
"; $output = null; exec("/usr/bin/wget --spider --user=admin --password=lp44-fr8@NTE 192.168.0.180:Public/test/", $output); foreach ($output as $line) echo "$line
"; $result = ""; } else { $ini_array->save(); echo $url_npkg_list; // Return to the list } } // Edit job processing else if ( isset($_GET['edit']) ) { $jobid = $_GET['edit']; $index = "Schedule$jobid"; $NAME = $ini_array->get($index,"Name"); $NAME = $ini_array->get($index,"Name"); $RR_CLIENT_MODE = $ini_array->get($index,"RSYNC MODE"); $SMB_LOCATION = $ini_array->get($index,"Remote IP"); $RR_CLIENT_PORT = $ini_array->get($index,"RSYNC PORT"); $REMOTE_VOL = $ini_array->get($index,"Remote Volume"); $REMOTE_PATH = substr($ini_array->get($index,"Remote Path"),1); $SMB_USERNAME = $ini_array->get($index,"User Name"); $SMB_PASSWD = $ini_array->get($index,"Password"); $LOCAL_VOL = $ini_array->get($index,"Local Volume"); $LOCAL_PATH = substr($ini_array->get($index,"Local Path"),1); $backup_type = $ini_array->get($index,"Schedule Type"); $b_day = $ini_array->get($index,"Week"); $b_week = $ini_array->get($index,"Month"); $TIME_HOUR = $ini_array->get($index,"Hour"); $TIME_MIN = $ini_array->get($index,"Minute"); $USE_OF_SSH = $ini_array->get($index,"Use of SSH")?"checked":""; $RR_SSH_PORT = $ini_array->get($index,"SSH PORT"); $COMPRESS = $ini_array->get($index,"Compressed")?"checked":""; $STOP_SERVICE = $ini_array->get($index,"Stop Net")?"checked":""; $INCREMENTAL_COPY = $ini_array->get($index,"Incremental")?"checked":""; $REMOVE_EX_FILE = $ini_array->get($index,"Delete Extra")?"checked":""; $mode = "edit"; } // Edit job form echo " "._NPKG_JOB_EDIT."