Topic "shell commands"

Author Message
daAgent

Guest


Hi there,
I'm new to winscp and would like to use it for a simple script (with the /console and /script options). This is what the script is like:
################
option batch on
option confirm off
cd /desired/directory
option transfer ascii
put someFiles*
option transfer binary
put anotherfile
close
exit
################

This works very well, but if I want to execute shell commands I don't get it. What I want is something like:
################
option batch on
option confirm off
cd /desired/directory
option transfer ascii
put someFiles*
option transfer binary
put anotherfile

tar cf - someFiles* | gzip > someFiles.tgz

close
exit
################

I found in the forum and some documentation that it is possible to use custom commands but I did not find how to define and how to use them. And I found that things like
cp ! /backup/!`date +%Y%m%d`
should be possible, but again I didn't find the syntax explanation.
I tried
! tar cf - someFiles* | gzip > someFiles.tgz
and
"!" tar cf - someFiles* | gzip > someFiles.tgz

but I always get the error that the command "!" is unknown.

I'm using winscp374.exe (the standalone application download).

Could you please explain the syntax to me and at best give me an example how to use an shell command in such a script.

Many thanks
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24553
Location: Prague, Czechia
Command "call" (or "!") is supported since 3.7.5 only.

BTW, you cannot use custom commands in script.
_________________
Martin Prikryl
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