Two things: exit command and ovewriting of the log file

Advertisement

leonardo07746
Joined:
Posts:
11
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 different log file every time the script activates and not overwrite the same log every time.

THANKS

Reply with quote E-mail

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
41,390
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

Also your option commands at the beginning of the batch cannot be there. They must be on the WinSCP commandline.

Reply with quote

leonardo07746
Joined:
Posts:
11
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"

Reply with quote E-mail

Advertisement

You can post new topics in this forum