Page 1 of 1

Backup operation

Posted: 21 Aug 2014 12:34
by binocular222
Sadly, XY's backupto has some flaws
- If I backup from source folder S to destination folder D, then, files existed in D but not in S are not deleted. Therefore, D maybe bigger than S. This is a problem when I rename a file in S, do the backup, and whoops, there're 2 copies of that file in D.
- If I set [create_log] to 1, then XY pop-up a dialog box to ask where to save. [create_log] should specify .log location and do things silently.

I'm looking for a 3rd party workaround such as GoodSync's command-line version (GSYNC), http://www.goodsync.com/support/manual#cl_gsync
foreach($item, <clipboard>, "<crlf>") {
run """E:\Utilities\GoodSync\gsync.exe"" job-tmp TempBak /sync /f1=file:///""$item"" /f2=file:///""<curpath>"" /dir=ltor /no-gsdata1=yes /no-gsdata2=yes /copy-locked=yes /copy-attrs=yes /copy-create-time=yes";
}

Re: Backup operation

Posted: 21 Aug 2014 13:04
by bdeshi
I haven't used the app, but does this work?
It converts '\' to '/' and puts "file:///" inside quotes.

Code: Select all

 foreach($item, <clipboard>, "<crlf>") {
  $f1 = replace($item,"\","/");  $f2 = replace(<curpath>,"\","/");
  run <<<#rungsync
"E:\Utilities\GoodSync\gsync.exe" job-tmp TempBak /sync /f1="file:///$f1" /f2="file:///$f2" /dir=ltor /no-gsdata1=yes /no-gsdata2=yes /copy-locked=yes /copy-attrs=yes /copy-create-time=yes#rungsync;
}
Also the linked manual says GSync returns specific error codes to the cmdprompt (or the log file). You could try a runret to get any returned errors.

Re: Backup operation

Posted: 21 Aug 2014 13:07
by admin
Backup is not Synch. :roll:

Re: Backup operation

Posted: 21 Aug 2014 13:18
by highend
Are all items in the clipboard folders?

Afaik you can't sync single files...

Re: Backup operation

Posted: 21 Aug 2014 13:47
by binocular222

Code: Select all

	foreach($item, <clipboard>, "<crlf>") {
		$ItemType = property("Type","$item");
		if($ItemType == "File folder") {
			$base = getpathcomponent($item, "base");
			if( exists("<curpath>\$base") == 0) {new($base, "dir")};
			run """E:\Utilities\GoodSync\gsync.exe"" /lf=""D:\Doc\Temporary"" /ll=2 /progress=yes job-tmp TempBak /sync /f1=file:///""$item"" /f2=file:///""<curpath>\$base"" /dir=ltor /no-gsdata1=yes /no-gsdata2=yes /copy-locked=yes /copy-attrs=yes /copy-create-time=yes";
		} Elseif(strpos($ItemType,"Disk") == -1 AND strpos($ItemType,"Drive") == -1) {
			backupto "<curpath>", $item, 1,1,0,0,1,0,0;
		}
	}
I notice that there's no need to convert backslash to forward slash. For single files, I still use XY backupto.
@Don: Why backup is not sync? When I backup Source to Destination, I expect both 2 folders to be exactly identical after backup

Re: Backup operation

Posted: 21 Aug 2014 14:32
by admin
Check the manual... I never heard of a backup that deletes items in the destination.

Re: Backup operation

Posted: 21 Aug 2014 14:33
by Stef123
binocular222 wrote:When I backup Source to Destination, I expect both 2 folders to be exactly identical after backup
Not desired behavior, imo. Very often the Source(s) consist of subsets of the backup drive. I have smaller amounts of (current) customer data on my notebook (size matters), and yet back it up to my external 4TB drives into the very same customer folders that may have tons of older stuff and versioning - which makes it a backup drive, imo, as opposed to my "mirror" drives that I carry along to sync various machines.