Limit log file size, command line, XP

Advertisement

jpratt
Joined:
Posts:
7

Limit log file size, command line, XP

Trying to figure out a way I can limit the size of the log file on a Windows XP machine running WinSCP through command line.

Command line looks similar to this
"C:\Program Files\WinSCP3\WinSCP.exe"  /log=logfile.txt /command "open user:pass@server.com" "get *.* c:\folder\" "exit"
Thanks for your help.

Reply with quote

Advertisement

jpratt

It would be good because the log file is 6MB after one transfer, I am doing one transfer per day, and I would like to limit the size it can grow to.
I don't want to go in every week/month and delete the file.

Reply with quote

jpratt

Not delete but limit the size it can grow to, so as it appends to the file it would remove older entries needed to keep the file size at or below the predetermined setting.

Reply with quote

Advertisement

Srknt
Guest

Re: limit log file size, command line, xp

Hi there,
Do you have solution for the above?
How to control log verbosity from command line? I don't want to use ini file with other 1000 options.
When I am using ini and have just logging section saved to it, it works fine but after script is run, it write all other options to ini file. That is the reason I dont want to use ini.

Reply with quote

martin
Site Admin
martin avatar

Re: limit log file size, command line, xp

Srknt wrote:

When I am using ini and have just logging section saved to it, it works fine but after script is run, it write all other options to ini file. That is the reason I dont want to use ini.
You can set the INI file read-only.

Reply with quote

Advertisement

Advertisement

Guest

Hi Guys,
Was there ever a solution to this? I would really like to purge/limit the log file on a nightly basis but can't see how.

Reply with quote

Advertisement

martin
Site Admin
martin avatar

Re: I second the need for limiting log size option

@ctrunk514: Can you describe your use case? How big does your log file (for a single session) get that you need to limit its size?

Reply with quote

ambam
Joined:
Posts:
1
Location:
US

I agree that this would be a nice feature.

Use Case:
Synchronizing directories on a production web server and offsite backup server nightly

After a single session, log file reach's 45MB

Reply with quote

Advertisement

vanhauto
Guest

add max-size as parameter

Is it not possible to use the following syntax?
WinSCP /log=logfile.txt /logsize=5MB /command "open user:pass@server.com" "get *.* c:\folder\" "exit"
If the filesize reaches 5MB, a new log-file (with datetime-suffix) will be created.

This way, we can use a daily transfer-script to transfer the old log-files to an archive.

+1 for higher priority

Reply with quote

Mari059
Guest

Hi all,

I also need help to this.

My "logs" folder must not exceed 100mb. But I can't limit each log size file in it.

How can I do this, please ? I 'm little newbie on this work.

Reply with quote

Advertisement

You can post new topics in this forum