Hello,
we are testing some sync tools and filesync looks best at the moment beside one thing.
our structure is a mirror sync with a ffs_batch file which is looking up if something has changed on the server and than sync it to c:
We only want folder02 with all it´s files and subfdolders to sync not the other ones so we exclude it in the filter section
Source - \\server01\projectFolder01\folder02\files.txt
Destination - c:\localFolder\
after syncing we are having local the right folder structure (this is working)
c:\localFolder\projectFolder01\folder02\files.txt
but when we are deleting the project on the server (\\server01\projectFolder01) the sync only deletes all the files under the folder02 locally so we are ending up with empty folders on c:\ look like this
c:\localFolder\projectFolder01\folder02
how can we fix this that it is also deleting "projectFolder01\folder02" because it does not exist anymore on the server?
we already tried to implement a post command in the ffs_batch file looked like this. But this is also not working the command is (for /f "delims=" %%d in ('dir /s /b /ad "C:\localFolder\" ^| sort /r') do rd "%%d" 2>nul)
<PostSyncCommand Condition="Completion">
<Command>cmd.exe /k "\\server01\cleanUpEmptyFolder.bat"</Command>
<Wait>true</Wait>
</PostSyncCommand>
thanks
deleteEmpty folders
- Posts: 3
- Joined: 23 Oct 2025
- Attachments
-
- Screenshot 2025-10-23 140046.png (47.26 KiB) Viewed 112 times
-
- Screenshot 2025-10-23 135859.png (34.31 KiB) Viewed 112 times
-
- Screenshot 2025-10-23 135714.png (52.17 KiB) Viewed 112 times
- Posts: 3
- Joined: 23 Oct 2025
solution with a completely new profile found
- Posts: 1222
- Joined: 8 May 2006
Which was?
In any case, does the for do iterate through all directories found, or does it stop with only the first found?
If the former, wouldn't that end up deleting all your directories under localFolder?
Oh, you're relying on the rd to fail (so to skip over) on non-empty directories.
(No telling, but I wouldn't bet on that assumption. Oh, I guess it's OK, but I'd rather ensure that a directory is empty before feeding it, & only it, to rd.)
In any case, does the for do iterate through all directories found, or does it stop with only the first found?
If the former, wouldn't that end up deleting all your directories under localFolder?
Oh, you're relying on the rd to fail (so to skip over) on non-empty directories.
(No telling, but I wouldn't bet on that assumption. Oh, I guess it's OK, but I'd rather ensure that a directory is empty before feeding it, & only it, to rd.)
- Posts: 3
- Joined: 23 Oct 2025
the solution with the bat file in a post process was working for us which is deleting all empty folders ..... i don´t know what the exact problem was with the first problem but it was not calling the post process after cleaning all profiles an making new once it was working