Post a reply

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

martin

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.
leonardo07746

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"
martin

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.
leonardo07746

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