Trouble with the number of log files (Log File Retention)

Advertisement

rmahon
Joined:
Posts:
1
Location:
USA-Texas

Trouble with the number of log files (Log File Retention)

Good Morning, I am trying to limit the number of log files I retain in my \Log directory. I am currently using the following parameter /logsize=7*20K. With this, I am hoping to only retain 7 log files in the \Log folder.

Here is my command line:
"C:\Program Files (x86)\WinSCP\winscp" /script="C:\SFTP_DATA\sFTP_Script\sftp.txt" /log="C:\SFTP_DATA\sFTP_Script\Log\sftp_!Y!M!D!T.log" /loglevel=0 /logsize=7*20K
Log files are being placed in the \Log directory successfully. The job has run 10 time and I now have 10 separate log files. See below...

sftp_20230126211501.log   1/26/2023 21:15   12 KB
sftp_20230125211201.log   1/25/2023 21:15   12 KB
sftp_20230124211501.log   1/24/2023 21:15   12 KB
sftp_20230123211500.log   1/23/2023 21:15   12 KB
sftp_20230122211500.log   1/22/2023 21:15   12 KB
sftp_20230121211501.log   1/21/2023 21:15   12 KB
sftp_20230120211501.log   1/20/2023 21:15   12 KB
sftp_20230119211501.log   1/19/2023 21:15   12 KB
sftp_20230118211500.log   1/18/2023 21:15   12 KB
sftp_20230117211501.log   1/17/2023 21:15   12 KB
I am currently using:
version 5.19.6 (Build 12002 2022-02-22)

Thank you in advance for any assistance in resolving this.
Rob Mahon

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
41,454
Location:
Prague, Czechia

Re: Trouble with the number of log files (Log File Retention)

Log file count limit (7*) does not work with the log filename timestamp patterns (!Y!M!D!T). That effectively makes all log names unique and have their own separate limits.

Reply with quote

Advertisement

You can post new topics in this forum