Start a Conversation

Unsolved

P

6 Posts

577

December 30th, 2022 03:00

run interactive commands on datadomain from the outside

Hi,

From a windows system ( Veeam server ) for test purposes I need to run the command

mtree retention-lock revert

on a datadomain appliance 

This command, unfortunately, is interactive ( you have to reply "yes" and the sysadmin password in order to completely execute the task, as you can see from here

sysadmin@XXXXXX# mtree retention-lock revert /data/col1/VEEAM_DDBOOST/BCKFILES/TestONE/TestONE.vbm

The 'mtree retention-lock revert' command removes retention-lock on this path thereby making it unprotected.
Are you sure? (yes|no) [no]: yes

ok, proceeding.

Please enter sysadmin password to confirm 'mtree retention-lock revert':

 

I don't know how to run it , for example via ssh.

Could you please give me some suggestions? The difficul part is the interactive one, so "typing" yes and the password requested...

Thanks in advance

Pierpa

February 1st, 2023 01:00

"expect" is your friend. Many examples to be found like: https://www.digitalocean.com/community/tutorials/expect-script-ssh-example-tutorial

Autoexpect might further help you to create the expect script:
https://hostadvice.com/how-to/how-to-automate-tasks-in-ssh/

 

2 Intern

 • 

20.4K Posts

February 1st, 2023 19:00

If you are scripting this process in Python, for example, you could use this command to send a "yes"

stdin.write('yes\n')
stdin.flush()

No Events found!

Top