Neustart einer VM in crontab

schloegel-edv

Member
Mar 23, 2020
70
4
13
42
Hallo,

ich möchte eine VM (ID: 101) jeden Tag neu starten. Dazu habe ich als Cronjob folgendes eingetragen: 0 5 * * * qm reboot 101
Es scheint aber nicht zu funktionieren, denn die Fehlermeldung "/bin/sh: 1: qm: not found" kommt.

Wenn ich das per Hand für die Shell ausführe klappt es aber.

Was kann ich tun?

Danke für Tips!
 
...änder den Cronjob mal auf /usr/sbin/qm ab - das wirkt Wunder ;)
Cron hat keine Shell oder Profile, von daher keine ihm bekannten Pfade und findet deshalb "qm" nicht. Eine Shell hat das alles üblicherweise.
 

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!