cancel
Showing results forĀ 
Search instead forĀ 
Did you mean:Ā 

Python script triggered by UPM doesn't work properly

Python script triggered by UPM doesn't work properly

eyeV
New Contributor III
Hi everybody.
I use x480 with 16.1.2.

I have simple .py script like this.
import pexpect
import exsh
exsh.clicmd ('create log message "Starting NSCBackup!"')
for i in range(1,10):
print(i)
p = pexpect.spawn('/exos/bin/ssh -r 2 USERNAME@172.20.1.' + str(i))
idx = p.expect(['password', pexpect.EOF, pexpect.TIMEOUT])
p.sendline('SECRETPASS')
idx = p.expect(['sCore', pexpect.EOF, pexpect.TIMEOUT])
p.sendline('create log message "Not so cold backuper"')
idx = p.expect(['sCore', pexpect.EOF, pexpect.TIMEOUT])
p.sendline('save')
idx = p.expect(['(y/N)', pexpect.EOF, pexpect.TIMEOUT])
p.sendline('y')
idx = p.expect(['sCore', pexpect.EOF, pexpect.TIMEOUT])
p.sendline('scp2 vr "VR-Default" sCore' + str(i) + '.cfg USERNAME@172.20.1.10:sCore' + str(i) + '.cfg')
idx = p.expect(['password', pexpect.EOF, pexpect.TIMEOUT])
p.sendline('SECRETPASS')
p.sendline('exit')Not so beautiful, but it works!

So... I can run it with "load script NSCB.py". It works properly.

Then I created and scheduled UPM profile like this.
create upm profile NSCB
load script NSCB.py
.
create upm timer NSCBtimer
configure upm timer NSCBtimer profile NSCB
configure upm timer NSCBtimer at 11 5 2015 23 50 0 every 86400And I run it:
run upm profile "NSCB" I see some log messages, but script stucked.
11/06/2015 15:55:19.94 Starting NSCBackup!
11/06/2015 15:55:19.54 Launched profile NSCB for the event user-request

Any suggestions?
21 REPLIES 21

OscarK
Extreme Employee
ok, I think you should add some checks where you send some info to the log to keep track where it is stuck.

eyeV
New Contributor III
Unfortunately no.
GTM-P2G8KFN