Running a command in Script

Advertisement

marshyrob
Joined:
Posts:
1

Running a command in Script

Hi All

Im very new to scripting and WINSCP. Ive made a script which logs into a F5 loadbalancer (3BSD) and copies a backup file down to a directory. This works fine. I would like to run a command, once logged in via the script, to create a backup.

The command is "b config save <filename>"

How do i run this command via the script. I have had a look on this site but i cant seem to find any examples. Is it even possible?

Here is my script:


option batch on
option confirm off
open xxxx:xxxxx@xxxxxx
cd /usr/local/ucs
option transfer binary
get *LBL* c:\F5Backups\
close

Any help would be appreciated.

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
27,252
Location:
Prague, Czechia

Re: Running a command in Script

Use script command call.
_________________
Martin Prikryl

Reply with quote

Guest

Re: Running a command in Script

martin wrote:

Use script command call.

Hi Martin

Thanks for the reply, i tried add in the call statement and got the follwoing error when i ran the script:

failed with return code 1 and error message
Error opening terminal: dumb..

My script looks like this now:


option batch on
option confirm off
open xxxx:xxxxx@xxxxx
cd /usr/local/ucs
call config save xxxCYx5xPC
option transfer binary
get *LBL* c:\F5Backups\
close

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
27,252
Location:
Prague, Czechia

Re: Running a command in Script

Please read documentation about limitations of remote commands exeuction.
_________________
Martin Prikryl

Reply with quote

Advertisement

You can post new topics in this forum