Hi to all,
I m looking for a sulution for start VM(105) everyday at 7:00 if it is stopped.
it's not worked in crontab.
start.sh
#! /bin/bash
status=`qm status 105 | awk -F " " '{print $2}'`
if [ $status = "stopped" ] ; then
qm start 105
fi
crontab -l
0 7 * * * /var/lib/vz/snippets/105/start.sh
logs:
Feb 23 07:00:00 proxmox systemd[1]: Starting Proxmox VE replication runner...
Feb 23 07:00:01 proxmox systemd[1]: pvesr.service: Succeeded.
Feb 23 07:00:01 proxmox systemd[1]: Started Proxmox VE replication runner.
Feb 23 07:00:01 proxmox CRON[21835]: pam_unix(cron:session): session opened for user root by (uid=0)
Feb 23 07:00:01 proxmox CRON[21836]: (root) CMD (/var/lib/vz/snippets/105/start.sh)
Feb 23 07:00:02 proxmox CRON[21835]: pam_unix(cron:session): session closed for user root
Feb 23 07:00:02 proxmox postfix/pickup[9174]: 1395923055: uid=0 from=<root>
Feb 23 07:00:02 proxmox postfix/cleanup[21843]: 1395923055: message-id=<20240222230002.1395923055@proxmox.host>
Feb 23 07:00:02 proxmox postfix/qmgr[4756]: 1395923055: from=<root@proxmox.host>, size=675, nrcpt=1 (queue active)
Feb 23 07:00:02 proxmox pvemailforward[21847]: forward mail to <root@local.host>
I m looking for a sulution for start VM(105) everyday at 7:00 if it is stopped.
it's not worked in crontab.
start.sh
#! /bin/bash
status=`qm status 105 | awk -F " " '{print $2}'`
if [ $status = "stopped" ] ; then
qm start 105
fi
crontab -l
0 7 * * * /var/lib/vz/snippets/105/start.sh
logs:
Feb 23 07:00:00 proxmox systemd[1]: Starting Proxmox VE replication runner...
Feb 23 07:00:01 proxmox systemd[1]: pvesr.service: Succeeded.
Feb 23 07:00:01 proxmox systemd[1]: Started Proxmox VE replication runner.
Feb 23 07:00:01 proxmox CRON[21835]: pam_unix(cron:session): session opened for user root by (uid=0)
Feb 23 07:00:01 proxmox CRON[21836]: (root) CMD (/var/lib/vz/snippets/105/start.sh)
Feb 23 07:00:02 proxmox CRON[21835]: pam_unix(cron:session): session closed for user root
Feb 23 07:00:02 proxmox postfix/pickup[9174]: 1395923055: uid=0 from=<root>
Feb 23 07:00:02 proxmox postfix/cleanup[21843]: 1395923055: message-id=<20240222230002.1395923055@proxmox.host>
Feb 23 07:00:02 proxmox postfix/qmgr[4756]: 1395923055: from=<root@proxmox.host>, size=675, nrcpt=1 (queue active)
Feb 23 07:00:02 proxmox pvemailforward[21847]: forward mail to <root@local.host>
Last edited: