Backup operation

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Post Reply
binocular222
Posts: 1423
Joined: 04 Nov 2008 05:35
Location: Win11, Win10, 100% Scaling

Backup operation

Post 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";
}
I'm a casual coder using AHK language. All of my xys scripts:
http://www.xyplorer.com/xyfc/viewtopic. ... 243#p82488

bdeshi
Posts: 4256
Joined: 12 Mar 2014 17:27
Location: Asteroid B-612
Contact:

Re: Backup operation

Post 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.
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

admin
Site Admin
Posts: 66346
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: Backup operation

Post by admin »

Backup is not Synch. :roll:

highend
Posts: 14953
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: Backup operation

Post by highend »

Are all items in the clipboard folders?

Afaik you can't sync single files...
One of my scripts helped you out? Please donate via Paypal

binocular222
Posts: 1423
Joined: 04 Nov 2008 05:35
Location: Win11, Win10, 100% Scaling

Re: Backup operation

Post 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
I'm a casual coder using AHK language. All of my xys scripts:
http://www.xyplorer.com/xyfc/viewtopic. ... 243#p82488

admin
Site Admin
Posts: 66346
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: Backup operation

Post by admin »

Check the manual... I never heard of a backup that deletes items in the destination.

Stef123

Re: Backup operation

Post 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.

Post Reply