[SOLVED] Shutdown and start mv from cron error

metaenlace

Member
Dec 18, 2019
10
1
23
60
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?
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!