[SOLVED] /etc/cron.d funktioniert nicht

noPa$$word

Renowned Member
Feb 12, 2010
358
42
93
Installiert ist die aktuelle Proxmox PVE 6.3 (PVE Manager Version - pve-manager/6.3-3/eee5f901) mit allen Updates.

Ich versuche cv4pve-autosnap zu verwenden. Die Datei habe ich in /var/local/bin/ kopiert. Die manuelle Verwendung in der Konsole funktioniert.

Ich versuche mit der nachfolgenden Datei in /etc/cron.d/snapshot

Code:
Inhalt von snapshot:

PATH=/usr/bin:/bin:/usr/local/bin

SNAP_HOST="127.0.0.1"
SNAP_USER="root@pam"
SNAP_PASS="Passwort"

# "all" for all VMs, exceptions with "-123" possible, or just the following VMs: "123,124"
SNAP_VMID="456"

SNAP_KEEP_HOURLY=2
SNAP_KEEP_DAILY=6
SNAP_KEEP_WEEKLY=4
SNAP_KEEP_MONTHLY=2

# hourly
0 1-23    *    *    *    root    cv4pve-autosnap --host="$SNAP_HOST" --username="$SNAP_USER" --password="$SNAP_PASS" --vmid="$SNAP_VMID" snap --label="hourly" --keep="$SNAP_KEEP_HOURLY" > /dev/null

# weekly -> So; daily -> Mo-Sa
0 0    2-31    *    *    root    [ "$(date +\%u)" = "7" ] && cv4pve-autosnap --host="$SNAP_HOST" --username="$SNAP_USER" --password="$SNAP_PASS" --vmid="$SNAP_VMID" snap --label="weekly" --keep="$SNAP_KEEP_WEEKLY" > /dev/null || cv4pve-autosnap --host="$SNAP_HOST" --username="$SNAP_USER" --password="$SNAP_PASS" --vmid="$SNAP_VMID" snap --label="daily" --keep="$SNAP_KEEP_DAILY" > /dev/null

# monthly
0 0    1    *    *    root    cv4pve-autosnap --host="$SNAP_HOST" --username="$SNAP_USER" --password="$SNAP_PASS" --vmid="$SNAP_VMID" snap --label="monthly" --keep="$SNAP_KEEP_MONTHLY" > /dev/null

Snapshots zu erzeugen. Die Dateirechte sind auf root:root gesetzt.
Es will aber nicht funktionieren.

Ein run-part --test /etc/cron.d/ ergibt keine Ausgabe.
Ein run-part --test /etc/cron.daily/ ergibt die erwartete Ausgabe mit den im Ordner vorhandenen Dateinamen.

funktioniert /etc/cron.d nicht?
Die bereits darin vorhandenen Dateien mdadm und zfsutils-linux scheinen auch nicht zu funktionieren.

Wo kann ich ansetzen?

Fehler gefunden:
Ich hatte die Dateirechte von /etc/crond.d/snapshot falsch gesetzt. Hatte 0644 statt 0755 gesetzt.
 
Last edited:
Danke für das Beschreiben der selbst gefundenen Lösung! :)
 

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!