4

I try to do a automatic backup of our Avocent Console server.

Content of backup.cmd:

putty.exe -ssh root@acs01.NULL.local -pw secretpw -m acs01.txt

Content of acs01.txt:

cli
cd system_tools/
save_configuration
set ip_address=10.0.0.1
set path_and_filename=/avocent/acs01
set username=ftpacs01
set password=anothersecretpw
save
finish
exit
exit

All works fine, but I have one problem. PuTTY comes only to execute the command cli, all other commands are not executed.

Is it possible to do a short break after each command?

Or is it because the cli is a separate interface in the Avocent?

Thank you

11
  • 2
    What kind of system is this. What is the cli command. If this is bash, you should not need to put delays in between the commands.
    – Aaron
    Aug 25, 2015 at 19:39
  • What system is the SSH server on? I'm presuming Windows. If so, what's the CLI command directed at? Aug 25, 2015 at 19:56
  • 1
    If you're saying that the cli command starts its own pseudo-shell, then yes, this is the problem. The real shell is likely waiting for the cli processes to complete before continuing with the other commands. If you were to exit the cli application it would probably run the other commands.
    – heavyd
    Aug 25, 2015 at 20:06
  • @heavyd any idea what his cli program is?
    – barlop
    Aug 25, 2015 at 20:55
  • Looks like an Avocent Command Line Configuration Utility
    – heavyd
    Aug 25, 2015 at 20:58

2 Answers 2

1

If the cli starts a "new shell", the master shell waits for it to exit and never runs your other commands.

Though, you apparently want to run your commands within the cli shell, not after it (maybe except the second exit, which probably should exit the master shell).

For that you have to use an appropriate syntax of your system or an appropriate command-line parameter of cli. You server seems to be some proprietary system, so I do not know the correct syntax. Neither I've found any appropriate command-line parameter of cli in documentation I've found on-line.

On Linux system a generic solution would be:

cli <<EOF
cd system_tools/
save_configuration
set ip_address=10.0.0.1
set path_and_filename=/avocent/acs01
set username=ftpacs01
set password=anothersecretpw
save
finish
exit
EOF
exit
0

thanks to all for reply & help. After all, i found a solution. The avocent console server contains 2 alternative commands. Wich do exactly what i need.

saveconf --help restoreconf --help

<

thx + best regards schtebo

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.