Hi, I'm trying to power off then power on a virtual machine from cron.
Script to shutdown:
root@svrmetamvs3:~/scripts# cat ApagaMvGLPI.sh
#!/bin/bash
# apagar mvglpi
qm shutdown 300101
script to activate:
root@svrmetamvs3:~/scripts# cat EnciendeMvGLPI.sh
#!/bin/bash
# Encender mvGLPI
qm start 300101
cron:
root@svrmetamvs3:~/scripts#
crontab -l
50 12 * * * root /root/scripts/ApagaMvGLPI.sh
55 12 * * * root /root/scripts/ActivateMvGLPI.sh
from the command line:
qm shutdown 300101 and qm start 300101 works fine
the scripts :
sh ApagaMvGLPI.sh and sh EnciendeMvGLPI.sh works fine
from cron it gives me this error:
/root/scripts/ApagaMvGLPI.sh: line 3: qm: command not found
Any idea what I'm doing wrong?
Script to shutdown:
root@svrmetamvs3:~/scripts# cat ApagaMvGLPI.sh
#!/bin/bash
# apagar mvglpi
qm shutdown 300101
script to activate:
root@svrmetamvs3:~/scripts# cat EnciendeMvGLPI.sh
#!/bin/bash
# Encender mvGLPI
qm start 300101
cron:
root@svrmetamvs3:~/scripts#
crontab -l
50 12 * * * root /root/scripts/ApagaMvGLPI.sh
55 12 * * * root /root/scripts/ActivateMvGLPI.sh
from the command line:
qm shutdown 300101 and qm start 300101 works fine
the scripts :
sh ApagaMvGLPI.sh and sh EnciendeMvGLPI.sh works fine
from cron it gives me this error:
/root/scripts/ApagaMvGLPI.sh: line 3: qm: command not found
Any idea what I'm doing wrong?