<?php
/*<outscirt><version>20180409</version></outscirt>*/

function O__backupData($target,$delete){
	global $O__backupsPath;
	
	if(is_file($target)){
		$O__escapedPath = str_replace("/", "-", $target);
		$O__dateAndTime = date("Y-m-d") . "_" . date("h-i-s");
		
		//echo($target . "-----" . $O__backupsPath . "/" . $O__escapedPath . ".bak_" . $O__dateAndTime);
		copy($target, $O__backupsPath . "/" . $O__escapedPath . ".bak_" . $O__dateAndTime);
		if($delete==1){ unlink($target); }
	}
}
?>
