Logs not deleting per options setting

Get help for specific problems
Posts: 4
Joined: 22 May 2024

TDIPUF

Hey folks, I've got a question about logs. In the general options, I've selected to delete logs after 1 day, but they don't delete (see picture). I've got 2 jobs. In the picture there are two logs for each job; one from yesterday and one from today. As I understand it, the ones from yesterday should've deleted but they didn't. I searched the forum but couldn't find a satisfactory answer to this. Anyone know what gives? I'm using FFS 13.6

Clipboard_05-22-2024_01.jpg
Clipboard_05-22-2024_01.jpg (35.23 KiB) Viewed 138 times
User avatar
Posts: 3718
Joined: 11 Jun 2019

xCSxXenon

I also have logs set to 1 day. From the testing I just did, it works like this:
- The cleanup only occurs once you run another FFS sync. This makes sense since FFS has to be running to perform this check and cleanup
- For all configurations, FFS keeps the last log no matter how old it is. This makes sense because the 'last status' column likely depends on it
- For the sync configuration you run, it will clean up according to the settings, meaning it will keep the last one that exists
- BUT since you just ran it, it creates a new one. Seems like there will always be two logs for whatever sync is most recently run

This is my log folder before running FFS for the day:
Before.jpg
Before.jpg (79.26 KiB) Viewed 130 times
This is the folder after running the "Tools" configuration I have:
After.jpg
After.jpg (61.35 KiB) Viewed 130 times
And here it is after running the same configuration again:
After Again.jpg
After Again.jpg (60.9 KiB) Viewed 130 times
FFS must be doing the cleanup before running the sync which allows an edge case where the most recent log file is older than the time setting specified and it then becomes not the most recent log
User avatar
Posts: 3718
Joined: 11 Jun 2019

xCSxXenon

Although looking at your picture, it still seems odd. According to my testing and description, I would expect the "02 Macrium Images" log from 5-21 to have been deleted. It was run first today, so having two logs makes sense. But then you ran the "01 My Files" sync, which would cause that to have two logs, expectedly, but then it also would have deleted the Macrium log from yesterday
Posts: 4
Joined: 22 May 2024

TDIPUF

I just did a test on "01 My Files" and now there are 3 logs for that job. It's not deleting anything.
User avatar
Posts: 3718
Joined: 11 Jun 2019

xCSxXenon

Go to Tools->Options and post a screenshot of the settings window
Posts: 4
Joined: 22 May 2024

TDIPUF

As I said in my original post, I have it set to delete logs after 1 day. Is there another setting I should be looking at?
User avatar
Site Admin
Posts: 7085
Joined: 9 Dec 2007

Zenju

FFS must be doing the cleanup before running the sync which allows an edge case where the most recent log file is older than the time setting specified and it then becomes not the most recent log xCSxXenon, 22 May 2024, 14:16
Your explanations are spot on. There is indeed a little bug in the current handling. The latest log file for each of the configurations shown on config list on GUI is never deleted. But that didn't account for the fact that for the currently run config a new log file will be created.
Log file pruning cannot simply be placed at the end because potential failures in this regard must also be logged. Almost a catch-22, but luckily the fallback log folder path on %appdata%\FreeFileSync can generally be assumed to work.

Here's the fixed version: https://www.mediafire.com/file/ao5ybg9uwd28560/FreeFileSync_13.7_%255BBeta%255D_Windows_Setup%25283%2529.exe
Posts: 4
Joined: 22 May 2024

TDIPUF

Thanks for the Beta. It finally did delete one log file today when I ran a sync. But there are still two logs rather than one. I guess it doesn't matter so long as they're being culled. I'll try the Beta. Thanks again.