Page 1 of 2

automatically including new sub folders but not root level and generating a text list/report of what will be done

Posted: Fri Nov 25, 2022 5:48 am
by IMTheNachoMan
I have two questions I can't seem to find in the help or FAQ:

1) Generate a files list

Can I have Syncovery dump a text file of what it will do? Like what files it will copy? I have 1.5 TB of files and I want to go through the full list to make sure my masks/filters are set properly.

2) Exclude only folders

I have selected very specific top-level folders to be copied. When there are new sub folders in the top-level folders, then I want those to be automatically included. But if there is a new top-level folder created, I do not want it to be automatically included.

For example, say my base path is D:\ and I have these top-level folders and I have selected specific ones:
  • one
  • two (selected)
  • three
  • four (selected)
Then say, after some time, I have created more folders like this:
  • one/aaaa
  • two/bbb
  • three/ccc
  • four/ddd
  • five/eee
two/bbb and four/ddd should be automatically selected, but five and five/eee should not.

3) Excluding only folders, in any sub-directory by name

How can I exclude a folder by name, in any directory, but not files of the same name. So, I want to exclude any folder named test but I do not want to exclude any file named test.

For example, say my files are like this:
  1. D:\one\test\blah.txt
  2. D:\one\test (file)
  3. D:\one\.test (file)
  4. D:\two\test\.profile
I want to ignore all test folders. In my above example, 1 and 4 should be ignored, but 2 and 3 should not.

Re: automatically including new sub folders but not root level and generating a text list/report of what will be done

Posted: Fri Nov 25, 2022 10:04 am
by tobias
Hello,

1) To get an exportable list of the Sync Preview, you can run the profile by right-clicking it and choosing "Run in Background With Preview". When the preview is ready, please right-click the profile and choose "Show Detailed Progress or Results in Browser". This will open the Sync Preview in your web browser, where you can save it as HTML or copy and paste to another type of document.

2) You just need to remove the checkmark "Automatically Add Future New Folders and Files to Selection" from the top right corner of the subfolder selection dialog. New subfolders and files of entirely selected folders will always be included, even without this checkmark. The checkmark is only needed to add future new siblings of currently deselected items. Which is what you don't want.

3) Just type test in the Exclusion Masks. All items called test will be excluded, regardless of where they occur, and also regardless of whether they are a folder or file. Because file names usually have an extension, it should be fine. Files called test.jpg will not be excluded. Only folders called test will.

Re: automatically including new sub folders but not root level and generating a text list/report of what will be done

Posted: Fri Nov 25, 2022 2:54 pm
by IMTheNachoMan
Thanks.

I have both files and folders called test (without an extension). And I only want to exclude folders, but not files.

Re: automatically including new sub folders but not root level and generating a text list/report of what will be done

Posted: Fri Nov 25, 2022 7:17 pm
by IMTheNachoMan
So I did some tests. I have files like this.
  1. C:\Users\IEUser\Documents\data\one\.test
  2. C:\Users\IEUser\Documents\data\one\test
  3. C:\Users\IEUser\Documents\data\test\asdf.txt
  4. C:\Users\IEUser\Documents\data\two\file a.txt
  5. C:\Users\IEUser\Documents\data\two\file b.txt
  6. C:\Users\IEUser\Documents\data\two\test\.dingo
Those are all files.

If my exclusion mask is this:

Code: Select all

test
Then it copies these files. #2 from the above list is missing.
  • C:\Users\IEUser\test\data4\data\one\.test.s1.7z
  • C:\Users\IEUser\test\data4\data\two\file a.txt.s0.7z
  • C:\Users\IEUser\test\data4\data\two\file b.txt.s0.7z
What I am trying to do is get it to copy #1, #2, #4 and #5.

Only #3 and #6 should be skipped/excluded.

Re: automatically including new sub folders but not root level and generating a text list/report of what will be done

Posted: Fri Nov 25, 2022 7:19 pm
by tobias
Hi,
in that case, the selection must be done via a PascalScript, which you can add to the profile on the "Job" tab sheet. So don't use the Exclusion Masks, but use this:

Code: Select all

function OnIncludeItem(const FileName, RelativePath: UnicodeString;
        const isRightSide, isFolder:Boolean;
        const FileSize:Int64; const FileAttr:LongWord;
        const Connector: Opaque):Boolean;
begin
  Result:=not isFolder or (FileName<>'test');
  end;

Re: automatically including new sub folders but not root level and generating a text list/report of what will be done

Posted: Fri Nov 25, 2022 7:20 pm
by IMTheNachoMan
I see. Two questions:
  1. How can I add more folder name exclusions?
  2. Will this slow performance?

Re: automatically including new sub folders but not root level and generating a text list/report of what will be done

Posted: Fri Nov 25, 2022 7:25 pm
by tobias
Hi,
I think you should work on NOT having any files that have the same name as folders.

Files should always have a filename extension. Folders should not.

That makes it a non-issue.

But here's an example with more names. I don't think it slows Syncovery down a lot.

Code: Select all

function OnIncludeItem(const FileName, RelativePath: UnicodeString;
        const isRightSide, isFolder:Boolean;
        const FileSize:Int64; const FileAttr:LongWord;
        const Connector: Opaque):Boolean;
begin
  Result:=not isFolder or (FileName<>'test') and (FileName<>'test234') and (FileName<>'blablabla');
  end;

Re: automatically including new sub folders but not root level and generating a text list/report of what will be done

Posted: Fri Nov 25, 2022 7:33 pm
by IMTheNachoMan
tobias wrote:
Fri Nov 25, 2022 7:25 pm
I think you should work on NOT having any files that have the same name as folders.

Files should always have a filename extension. Folders should not.
In the development world, not all files have extensions. For example, some of my projects have a .config folder and some of my projects have a .config file. I want to exclude the .config folder but not the .config file.

Some binary applications may create a folder of the same name in another directory. I want to copy the binary application but not the folder.

I've got hundreds of files/folders like this. Not all are created by me.

I will try with the script.
tobias wrote:
Fri Nov 25, 2022 10:04 am
1) To get an exportable list of the Sync Preview, you can run the profile by right-clicking it and choosing "Run in Background With Preview". When the preview is ready, please right-click the profile and choose "Show Detailed Progress or Results in Browser". This will open the Sync Preview in your web browser, where you can save it as HTML or copy and paste to another type of document.
I've got 150k files. It's a bit painful to go through the pages of the browser. And if I try to select "All 162697'", it hangs the browser. Is there an easier way to have it dump all the files (and their full paths) to a text file? Maybe using the OnIncludeItem function with a Pascal Script?

Also, Tobias, are a developer or a support person? I'm reading other posts on this forum and it appears you are a developer of sorts? If so, then color me very impressed.

Re: automatically including new sub folders but not root level and generating a text list/report of what will be done

Posted: Sat Nov 26, 2022 5:31 am
by IMTheNachoMan
I got my file list thing figured out.

Code: Select all

function OnIncludeItem(const FileName, RelativePath: UnicodeString;
        const isRightSide, isFolder:Boolean;
        const FileSize:Int64; const FileAttr:LongWord;
        const Connector: Opaque):Boolean;
var logFile:Opaque;

begin
  Result:=(not isFolder) or ((FileName<>'.git') and (FileName<>'node_modules'));

  if Result then
    Log(RelativePath + '\' + FileName);
    
  end;

Re: automatically including new sub folders but not root level and generating a text list/report of what will be done

Posted: Sat Nov 26, 2022 10:04 am
by tobias
Hi,
yes I am the main developer of Syncovery. I think that some browsers might be able to handle "All 162697".

If you don't need to see the proposed actions and just want a complete file list, then you can also use another HTML export feature, which is on the Program Settings dialog, tab sheet Logs:

X Output Left/Right File Listings

This will save the listings as HTML files in the Logs folder.

You should turn it off when you no longer need it, because these files will never be deleted by Syncovery and will use a lot of disk space if you keep it on.