Hello,
I'm using FFS to Mirror Files to a dropbox share using a list generated in Excel. This list can and will change.
Is it possible to filter the subfolders for the list of items without having to select each individual subfolder in the left column?
Thank you :)
Mirror Files from Subfolders using a list
- Posts: 2
- Joined: 26 Nov 2018
- Posts: 2451
- Joined: 22 Aug 2012
This is a quite specific use case, which is not directly built into FreeFileSync (FFS).
So, some customization by the user seems required.
There might be more than one way to tackle this, but …
Possibly one of the simplest approaches is using the Include filter for this purpose.
The FFS-sync settings are normally stored in a *.ffs_gui file (or *.ffs_bat file).
If you open such file with a text-editor (e.g. Notepad++), you will see it is an XML-file and contains a Filter section
<Filter> <Include> … </Include>… </Filter>
In its simplest form, the <Include> … </Include> section only contains one item: <Item>*</Item> (meaning: everything in the left and right root-location is included, as far as not explicitly excluded).
If you would replace the <Item>*</Item> in the Filter/Include section with the content of your Excel-list, like
save the file under a selected name ([SelectedName].ffs_gui) and run that file with FFS, the sync should only include the subfolders specified in the Filter section, and nothing else.
Note that [PathToSubfolderX] needs to be relative to the root of left and right base location, e.g. <Item>\[FolderinRootLocation)\[SubfolderLevel1]\[SubfolderLevel2]\*</Item>
If you have your list of subdirectories to be included in Excel, you should be able to generate such list by prepending every entry with <Item> and append it with </Item>.
You might then manually select that range and copy/paste it in the *.ffs_gui XML file replacing <Item>*</Item>, or you might do so via a script, e.g. a VBS script.
So, some customization by the user seems required.
There might be more than one way to tackle this, but …
Possibly one of the simplest approaches is using the Include filter for this purpose.
The FFS-sync settings are normally stored in a *.ffs_gui file (or *.ffs_bat file).
If you open such file with a text-editor (e.g. Notepad++), you will see it is an XML-file and contains a Filter section
<Filter> <Include> … </Include>… </Filter>
In its simplest form, the <Include> … </Include> section only contains one item: <Item>*</Item> (meaning: everything in the left and right root-location is included, as far as not explicitly excluded).
If you would replace the <Item>*</Item> in the Filter/Include section with the content of your Excel-list, like
…
<Filter>
<Include>
<Item>\[PathToSubfolder1]\*</Item>
<Item>\[PathToSubfolder2]\*</Item>
…
<Item>\[PathToSubfolderN]\*</Item>
</Include>
…
</Filter>
...
Note that [PathToSubfolderX] needs to be relative to the root of left and right base location, e.g. <Item>\[FolderinRootLocation)\[SubfolderLevel1]\[SubfolderLevel2]\*</Item>
If you have your list of subdirectories to be included in Excel, you should be able to generate such list by prepending every entry with <Item> and append it with </Item>.
You might then manually select that range and copy/paste it in the *.ffs_gui XML file replacing <Item>*</Item>, or you might do so via a script, e.g. a VBS script.
- Posts: 2451
- Joined: 22 Aug 2012
(Never tried this, but …)
Alternatively, you might specify a whole list of left-right base folder pairs when invoking FFS.
See https://freefilesync.org/manual.php?topic=command-line
You would then need to specify all your subfolders to be included as individual left-right pairs using the -Dirpair directive. There you obviously need to specify the full absolute path to the left and right location of the subfolders.
Alternatively, you might specify a whole list of left-right base folder pairs when invoking FFS.
See https://freefilesync.org/manual.php?topic=command-line
You would then need to specify all your subfolders to be included as individual left-right pairs using the -Dirpair directive. There you obviously need to specify the full absolute path to the left and right location of the subfolders.
- Posts: 2
- Joined: 26 Nov 2018
Thank you for the replies.
I exported the directory paths from the folders to an excel sheet and just copied and pasted into FFS,this didn't take as long as expected. The good thing is that the sub-folders are not likely to change very often. So now the bulk of sub-folders (about 180) are on it's not much of a hardship to add a couple more in the future.
I'll have a play around with the suggestions however and if I get anywhere I'll let you know. :)
Thanks again.
I exported the directory paths from the folders to an excel sheet and just copied and pasted into FFS,this didn't take as long as expected. The good thing is that the sub-folders are not likely to change very often. So now the bulk of sub-folders (about 180) are on it's not much of a hardship to add a couple more in the future.
I'll have a play around with the suggestions however and if I get anywhere I'll let you know. :)
Thanks again.