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

martin
Site Admin
martin avatar
Joined:
Posts:
27,459
Location:
Prague, Czechia

Re: limit log file size, command line, xp

What that would be good for?
_________________
Martin Prikryl

Reply with quote

jpratt
Joined:
Posts:
7

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

martin
Site Admin
martin avatar
Joined:
Posts:
27,459
Location:
Prague, Czechia

jpratt wrote:

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.
So you want WinSCP to delete beginning of the log in case a total size exceed certain limit?
_________________
Martin Prikryl

Reply with quote

jpratt
Joined:
Posts:
7

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

martin
Site Admin
martin avatar
Joined:
Posts:
27,459
Location:
Prague, Czechia

jpratt wrote:

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.
That's what I've meant :-)

Added to TODO list.

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
27,459
Location:
Prague, Czechia

Re: limit log file size, command line, xp

This issue has been added to tracker.
_________________
Martin Prikryl

Reply with quote

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
Joined:
Posts:
27,459
Location:
Prague, Czechia

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.
_________________
Martin Prikryl

Reply with quote

Matthijs
Guest

Re: limit log size

kfft wrote:

I confirm it would be very useful 8)

I can agree with this as well, or some option to rotate the logging.

Reply with quote

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

martin
Site Admin
martin avatar
Joined:
Posts:
27,459
Location:
Prague, Czechia

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.
There was no improvement in this respect yet.

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
27,459
Location:
Prague, Czechia

Re: I second the need for limiting log size option

ctrunk514 wrote:

I second the need for limiting log size option
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

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

martin
Site Admin
martin avatar
Joined:
Posts:
27,459
Location:
Prague, Czechia

Mari059 wrote:

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.
It will be possible to limit log size on WinSCP 5.10:
https://winscp.net/tracker/18

Reply with quote

Advertisement

You can post new topics in this forum