Page 1 of 1

Sync folders ignore Recycle bin

Posted: 17 Nov 2022 20:29
by I.R.Brainiac
Sync folders is terrific...except it also grabs hidden folders like the recycle bin.
I only spotted this because it was transferring 30 GBs of recycled files.

Maybe an option to ignore hidden files and folders?

thanks from Michael. :cup:

Silver lining...it showed me 30 gigs of recycled files that got orphaned by an OS crash and re-install. :shock:

Re: Sync folders ignore Recycle bin

Posted: 02 Dec 2022 08:06
by admin
Hmm, good point. I just wonder where to put this option in the UI... :maf: ... or make it a tweak, factory default "Sync folders ignores Recycle bin"? Opinions?

Re: Sync folders ignore Recycle bin

Posted: 02 Dec 2022 11:59
by klownboy
I don't think I'd ever want to sync "Recycle Bin" or "System Volume Information". Maybe someone else would. Though I can't see why - maybe for a full partition or disk image when using an imaging program. Back about a year ago I had failed at trying to eliminate the sync of Recycle Bin by using the "-" switch.

Re: Sync folders ignore Recycle bin

Posted: 03 Dec 2022 22:50
by I.R.Brainiac
My preference would be ignore hidden files and folders as default.
I'm sure there are cases where you would want them synced but nothing comes to mind.
Sync is a function I am relatively new to so I have only used it to sync personal files and music.I process all of my music so losing them isnt as easy as just redownloading.

Anything OS related is backed up with Rescuezilla or Macrium.

Long winded way of saying...I only want to sync visible files and folders by default and if I need hidden stuff i will make them visible and select them as well.

Maybe just make that default behavior.If its visible,its synced. :cup:

Re: Sync folders ignore Recycle bin

Posted: 04 Dec 2022 06:03
by jupe
Since you asked for opinions, I don't think auto excluding hidden files as has been suggested is a good idea because then important files like desktop.ini would be excluded. Since we are talking about GUI, maybe it would be an idea just to add a input field to the sync dialog that supports the same filter argument as the SC, then the default entries could be something like "-?:\$Recycle.Bin\|-?:\System Volume Info\".

Re: Sync folders ignore Recycle bin

Posted: 04 Dec 2022 08:30
by admin
klownboy wrote: 02 Dec 2022 11:59 Back about a year ago I had failed at trying to eliminate the sync of Recycle Bin by using the "-" switch.
This did not work? -?:\$Recycle.Bin\

Re: Sync folders ignore Recycle bin

Posted: 04 Dec 2022 12:31
by klownboy
admin wrote: 04 Dec 2022 08:30 This did not work? -?:\$Recycle.Bin\
In hindsight, I may be confusing attempts to exclude those folders using "/excl=" with quicksearch. It's been too long to remember what I had tried. I use "-" with other folders successfully. I'll check it out later today.

Re: Sync folders ignore Recycle bin

Posted: 04 Dec 2022 15:49
by klownboy
I ran a couple of tests and had no issues using sync with "-?:\$Recycle.Bin\|-?:\System Volume Info\". I only use sync in a scripting, not the GUI so I'm all set.. My issue a long while back was with SC quicksearch looking for certain folders and eliminating those subject folders from the results.

Re: Sync folders ignore Recycle bin

Posted: 04 Dec 2022 15:57
by admin
Good, thanks for testing. :cup:

Re: Sync folders ignore Recycle bin

Posted: 04 Dec 2022 18:17
by klownboy
I was too quick to say all is well with those sync exclusions. With Syntax checking ON for the first line in script below, I receive Dubious Syntax errors with "-?:\$Recycle.Bin\", one for $Recycle. I assume for the "$" and another for ".Bin" The exclusion does work and no problems with syntax checking off. I can also exclude "System Volume Information" folder by itself as in the second line below. I believe the syntax is correct, but for some reason I cannot get the exclusions to work for both "-?:\$Recycle.Bin\|-?:\System Volume Info\" when combined as in the third line.

Code: Select all

  $sync = <<<>>>
E:\<-->  I:\Temp|"E:\", "I:\Temp", 1, 0, 1, "cp",,"-?:\$Recycle.Bin\"|:sync   //works
E:\<-->  I:\Temp|"E:\", "I:\Temp", 1, 0, 1, "cp",,"-?:\System Volume Information\"|:sync   //works
E:\<-->  I:\Temp|"E:\", "I:\Temp", 1, 0, 1, "cp",,"-?:\$RECYCLE.BIN\|-?:\System Volume Information\"|:sync    // does not work
E:\<-->  I:\Temp|"E:\", "I:\Temp", 1, 0, 1, "cp",,"-?:\$RECYCLE.BIN\|?:\System Volume Information\"|:sync     // does not work
>>>;
   $sel = inputselect("     SOURCE         <-->          TARGET", $sync, <crlf>,1+4+32+1024+8192, , 300, 500, "<space 7>SYNC OPERATIONS");
   if($sel) {load "sync $sel", , "s";}

Re: Sync folders ignore Recycle bin

Posted: 04 Dec 2022 18:31
by jupe
It is to do with the inputselect listdata separator being |, so you'd need to script it differently, for example call them with a load instead, or like this:

Code: Select all

E:\<-->  I:\Temp|"E:\", "I:\Temp", 1, 0, 1, "cp",,"-?:\$RECYCLE.BIN\" . chr(124) . "-?:\System Volume Information\"|:sync

Re: Sync folders ignore Recycle bin

Posted: 04 Dec 2022 18:39
by klownboy
Don, regardless of the above, your beta v23.80.0103 does work in excluding both "$Recycle.Bin" as well as "System Volume Information" with syntax checking on. By the way on my system, "System Volume Info" is "System Volume Information", so I used SyncFilterGlobal=-?:\$Recycle.Bin\|-?:\System Volume Info*\ in XYplorer.ini.

Edit: To be clear, I do not receive the syntax errors mentioned above (with syntax checking on) when using sync "E:\", "I:\Temp", 1, 0, 1, "cp",,"-?:\$RECYCLE.BIN\|-?:\System Volume Information\"; so SC inputselect and "|" was causing that issue as well.

jupe thanks for the SC inputselect correction needed and the explanation. I should have tried it directly without inputselect.

Re: Sync folders ignore Recycle bin

Posted: 05 Dec 2022 10:02
by admin
Sure, "Information", not "Info"... :whistle: I'll fix the change log.

Re: Sync folders ignore Recycle bin

Posted: 09 Dec 2022 00:21
by I.R.Brainiac
I understood none of that so...I will just unhide everything before syncing and deselect unwanted items.

cheers :beer: