Posted: 2007-07-03 17:40
A nice feature would be the ability to get in the script file the variables defined from the DOS command line...
With this enhancement, you can do some batch jobs and then use the results in SCP scripts.
Best regards to all
Location: Prague, Czechia
You can easily generate the script with values you need automatically.
Posted: 2007-07-11 12:48
OK... I understand...
I will try !
Posted: 2007-09-26 08:39
It works well...
I use the SED command added on my Windows computer to manage files
I use the postie exe file to send mails for results
For example... I have a script that backups files from a Windows server to a Linux server
The problem is to select only files containing the date of the day in the file name
The main text script called SCR.TXT contains 2 lines like :
# Upload SGBD files to remote folder
put D:\files\zip\*AA*.zip /dev/backup/
Each night, a batch file do the following job :
1) It replace the AA string with the date of the day
2) It runs winscp.exe to transfer file to other server
3) It sends a mail containing the result of the process
Rem Replace the string "AA" in the text script with date of the day
sed -e s/AA/%yy%%mm%%dd%/ SCR.TXT > SCRIPT.TXT
Rem Initiate the file transfer
winscp.com /console /script=SCRIPT.TXT
Rem Send result by mail
IF NOT errorlevel 1 (
postie.exe -host:HOSTNAME -port:SMTPPort -s:"Backup ended on %COMPUTERNAME%" -to:MAIL_TO -from:MAIL_FROM -msg:"Server %COMPUTERNAME% : \r Process ended : %TIME%"
) ELSE (
postie.exe -host:HOSTNAME -port:SMTPPort -s:"Backup failed on %COMPUTERNAME%" -to:MAIL_TO -from:MAIL_FROM -msg:"Server %COMPUTERNAME% : \r Process ended : %TIME%"
Rem Give time to the batch process to send the mail
ping -n 10 localhost
I hope this can help to make nice scripts !
You can post new topics in this forum
And it's free!