Two things: exit command and ovewriting of the log file

Advertisement

leonardo07746
Joined:
Posts:
9
Location:
cuba

Two things: exit command and ovewriting of the log file

good morning, I need some help on these, the first problem is that the Exit command isn't closing the prompt when the script has finished the job, the cause is that it doesn't run again at the scheduled next time, the prompt stood there just open, the script goes like this

# Automatically abort script on errors
option batch abort

# Disable overwrite confirmations that conflict with the previous
option confirm off

# option transfer binary

cd c:\Program Files

cd WinSCP

@echo off

winSCP.com /command ^
"option batch abort" ^
"open ftp://ftpmetropolitano:ftpmetro@192.168.xxx.x1/ " ^
"synchronize local -delete -filemask=|*.rar C:\Sabic\JOURNAL /Journals/TRASVAL/ " ^
"/log=C:\logsdelScript2.log" /loglevel=1" ^
"exit"

and the second is that the log file has just increased almost a 1 gb file size, how can I do to create a diferent log file every time the script activates and not overwrite the same log every time.


THANKS
_________________
leo

Reply with quote E-mail

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
29,754
Location:
Prague, Czechia

Re: Two things: exit command and ovewriting of the log file

You have to move the exit after the other commands (before the /log). And use some log file name patterns to make the name unique.

winSCP.com /command ^
   "option batch abort" ^
   "open ftp://ftpmetropolitano:ftpmetro@192.168.xxx.x1/ " ^
   "synchronize local -delete -filemask=|*.rar C:\Sabic\JOURNAL /Journals/TRASVAL/ " ^
   "exit" ^
   "/log=C:\logsdelScript2_!Y!M!D!T.log" /loglevel=1

Reply with quote

leonardo07746
Joined:
Posts:
9
Location:
cuba

Re: Two things: exit command and ovewriting of the log file

YEP, the not overwriting request and patterns work like a charm, thanks, but the exit command is not working properly, the prompt is there everytime.
Does the "exit" command need to be before the "/log.............? that isn't working for me, what am i missing

"synchronize local -delete -filemask=|*.rar C:\Sabic\JOURNAL /Journals/TRASVAL/ " ^
"exit" ^
"/log=C:\LOGS_JOURNALS\logsdelScript_!Y_!M_!D_!T.log" /loglevel=1"

_________________
leo

Reply with quote E-mail

martin
Site Admin
martin avatar
Joined:
Posts:
29,754
Location:
Prague, Czechia

Re: Two things: exit command and ovewriting of the log file

This is correct. Make sure there's no space after all ^'s and there's at least one space on the following lines. See https://winscp.net/eng/docs/faq_batch_file

If you have problems, post a complete batch file as an attachment.

Reply with quote

Advertisement

You can post new topics in this forum