shell commands

Advertisement

daAgent
Guest

shell commands

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

Reply with quote

Advertisement

Advertisement

You can post new topics in this forum