Question - Sync files in multiple folders to a single destination folder?

Get help for specific problems
Posts: 4
Joined: 12 Apr 2021

Jacob1212

Hey there,

So a quick question here. I've searched around, and I imagine there must be some topic touching it, but this (viewtopic.php?t=4701) is as close as I found and it didn't really answer the question.

Scenario: For a digital picture frame, I want to sync the pictures from multiple folders and subfolders to a single destination folder on a (slowish) SD card. The filter would be *.jpg and the sync type 'Mirror'. Any minor changes in the destination folder are irrelevant. File names are unique and wouldn't conflict.

But the question is if there is any way to get all the files to just output to a single destination folder, as opposed to nesting each image in its respective nested folder hierarchy? This is a case of around 3000 jpg's and over 2500 folders, so nesting them makes no sense in this application.

The current alternative I'm considering is just activating 'Detect moved files', and after each Sync manually searching in Windows Explorer for '*.jpg', cutting all images, and pasting them in the image root, then deleting the superfluous folders in one go. With each sync all images would be moved to their original locations and I'd have to repeat the process, but at least they wouldn't have to transferred.

Anyway, I Imagine it isn't possible since I perfectly get this is a niche issue and reasonably outside the scope of a normal sync (not that it doesn't have a logical use), but I thought I'd ask just in case it's come up before.

Thanks ahead to anyone that can respond.
Posts: 4
Joined: 12 Apr 2021

Jacob1212

Just an update - The 'Detect moved files' doesn't seem to work in this scenario. Resyncing just deletes all the moved files and copies them in full once more. I suspect it's simply due to it being a removable drive and the time differential between the sync and the move being small, but it's just speculation.

If there's no trick or "hack" to do the "copy everything to the root folder", I can live with the added hassle and time investment, but it would be a pity.
User avatar
Posts: 2283
Joined: 22 Aug 2012

Plerry

As you concluded yourself, your use case is not a synchronization and not supported as an automatic feature in FreeFileSync (FFS).
As you have so many folders, using multiple left-right base folder pairs (different left source folders, the same right destination folder, and running an Update sync variant) does not seem to make sense.

The only thing you may consider, is to run a Compare between source and the intended or an arbitrary destination. Then (in FFS) select all files that would be copied over, and use the Copy to manual feature, obviously then copying to your intended destination folder. However, this will likely copy over ll files, including the ones that are already in the destination folder.

Probably a more suitable way to go about is (assuming Windows) to use the Windows File Explorer and go to the parent folder of all your folders comprising your *.jpg files, and do a search for *.jpg. Next you select and copy all found *.jpg files, and then paste those in your destination folder.
Windows File Explorer will/may then tell you that "The destination has X files with the same names". Those would be the files already previously copied to the destination. So, you can then select "Skip these files", so only the new files will be copied over. Note that this will not remove/delete any files that exist in your destination, but no longer exist in your source (equivalent to an FFS Update sync variant).
Posts: 4
Joined: 12 Apr 2021

Jacob1212

Thanks for the response, Plerry.

It's good to get an informed take on the subject so at least I don't waste time trying to get FFS to do it. It's a pity, but I understand how it's a somewhat (but not totally) niche use.

Regarding using Windows Explorer & skipping the duplicates, that actually would seem to be a lot more efficient timewise. Although now that I think about it, since the post was first written, I added a '[DS]' ("Don't Sync") suffix to the image filenames and added that to the filter list to keep certain images from syncing. FFS seems to work better with exclusions than Windows Explorer, as it doesn't check as many metadata values, avoiding unexpected results.

Anyway, I'll have to think about how to proceed but I'm glad for the input.
User avatar
Posts: 3602
Joined: 11 Jun 2019

xCSxXenon

There is probably an extremely easy batch script that would do this
Posts: 4
Joined: 12 Apr 2021

Jacob1212

There is probably an extremely easy batch script that would do this xCSxXenon, 13 Apr 2021, 16:02
Do you mean inside FFS, or outside? I don't think I've seen anywhere in FFS where custom scripts can be inputed (something I kinda think would be appreciated, as otherwise simple issues like this one illustrate).

Outside of FFS, it's a given there's some way to do it, it's just that none comes without a downside at least as large as FFS's downside. To be honest, though there may be easier/quicker/better ways to do it, there is some value in just doing it inefficiently in FFS to keep all sync jobs in one place and be able to track "last synced" dates easier.
Posts: 2
Joined: 18 Feb 2023

phpjunkie

Add each folder you want to drop into a legacy folder
Example:
Default Include -> *
Default Exclude -> leave it empty
%USERPROFILE%\Pictures -> D:\Pictures
Filter:This excludes all folders in %USERPROFILE%\Pictures.
Click the Default button in the bottom right corner, and add
*\
%USERPROFILE%\Pictures\Backgrounds ->  D:\Pictures
Filter: This excludes all folders in %USERPROFILE%\Pictures\Backgrounds.
Click the Default button in the bottom right corner, and add
*\
%USERPROFILE%\Pictures\Cars ->  D:\Pictures
Filter: This excludes all folders in %USERPROFILE%\Pictures\Cars .
Click the Default button in the bottom right corner, and add
*\
You'd have to break it down for every folder like that.
Tip: my experience with FreeFileSync I've learned that the folders chosen for source, and destination isn't always going to give you what you want, but repeating the source, and destination with different filters will give you what you want.

Example:
Source, and destination:
%USERPROFILE%\Documents - D:\Backup\Documents
Exclude filter:
Default with *\

Source, and destination:
%USERPROFILE%\Documents - D:\Backup\Documents
Include filter:
\Audacity\*
\Bulk Rename Utility\*
\eBooks\*
\Mindfulness Meditation\*
\The Mind and The Brain\*
\Website Development\*
Exclude filter:
\System Volume Information\
\$Recycle.Bin\
\RECYCLE?\
\Recovery\
*\thumbs.db
\FreeFileSync\*\*
*\File Synchronization
*\Backup