Topic "Two things: exit command and ovewriting of the log file"

Author Message
leonardo07746
[View user's profile]

Joined: 2015-08-06
Posts: 8
Location: cuba
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

Quote:

# 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
Advertisements
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25015
Location: Prague, Czechia
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.

Code:
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
leonardo07746
[View user's profile]

Joined: 2015-08-06
Posts: 8
Location: cuba
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

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

_________________
leo
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25015
Location: Prague, Czechia
This is correct. Make sure there's no space after all ^'s and there's at least one space on the following lines.

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

You can post new topics in this forum






Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License