I’ve got some directories being monitored by RealTimeSync whose contents are changed many times every day.
In the case of “ffs_batch jobs”, it would be nice if there were a way to control the number of log files retained instead of the number of days. Since a log file is generated every time a user file in a monitored directory is modified, created or deleted, a ton of them are generated over the course of a given day.
I’d like to retain maybe the last 25 or so. Perhaps there’s already a way to accomplish this, and I’ve missed it? It seems log maintenance can only be controlled globally via “Options > Delete logs after x days”. That’s just fine for “ffs_gui” jobs, since I only run them about once a week for full backups.
If not, please consider this a feature request. Keep up the great work in developing and maintaining FreeFileSync, I don’t know how I’d live without it!
- Windows 11, fully patched (guess I Iive dangerously)
- FreeFileSync version 14.4 – 64bit – 2025-07-26
RealTimeSync logs
-
- Posts: 9
- Joined: 10 May 2021
- Posts: 1223
- Joined: 8 May 2006
Maybe something along these lines, that you can run periodically, of call from FFS, Synchronization -> Run a command: On completion.
https://stackoverflow.com/questions/18553694/delete-all-but-x-most-recent-folders
https://stackoverflow.com/questions/18553694/delete-all-but-x-most-recent-folders
-
- Posts: 9
- Joined: 10 May 2021
Great idea, wish I thought of it! My batch file skills are a bit rusty, but this should be easy.
Thanks!
Thanks!
-
- Posts: 9
- Joined: 10 May 2021
This is what I wound up with: A Windows batch file that’s configured as the command to run when an RTS sync completes, which deletes all but the last 25 logs:
There’s probably a more elegant way to code it, but this works like a charm. Thanks again for the idea.
@echo off
REM Delete all but 25 newest RTS log files.
pushd "%USERPROFILE%\AppData\Roaming\FreeFileSync\Logs"
for /f "skip=25 delims=" %%a in (' dir RealTimeSync*.* /o-d /a-d /b ') do del "%%a"
popd