I installed the following crintab, to backup my /pve/etc folder daily:
Unfortunately the crontab does not execute. Instead the single command via ssh works just fine.
Any idea what could solve the problem?
systemctl status cron
crontab -e
0 0 * * * tar czvf /pve-backup/pve-backup-$(date +%F).tar.gz /etc/pve/
Unfortunately the crontab does not execute. Instead the single command via ssh works just fine.
Any idea what could solve the problem?
Code:
# Edit this file to introduce tasks to be run by cron.
#
# Each task to run has to be defined through a single line
# indicating with different fields when the task will be run
# and what command to run for the task
#
# To define the time you can provide concrete values for
# minute (m), hour (h), day of month (dom), month (mon),
# and day of week (dow) or use '*' in these fields (for 'any').
#
# Notice that tasks will be started based on the cron's system
# daemon's notion of time and timezones.
#
# Output of the crontab jobs (including errors) is sent through
# email to the user the crontab file belongs to (unless redirected).
#
# For example, you can run a backup of all your user accounts
# at 5 a.m every week with:
# 0 5 * * 1 tar -zcf /var/backups/home.tgz /home/
#
# For more information see the manual pages of crontab(5) and cron(8)
#
# m h dom mon dow command
0 0 * * * tar czvf /pve-backup/pve-backup-$(date +%F).tar.gz /etc/pve/
systemctl status cron
Code:
● cron.service - Regular background program processing daemon
Loaded: loaded (/lib/systemd/system/cron.service; enabled; preset: enabled)
Active: active (running) since Tue 2025-01-07 10:55:19 CET; 41min ago
Docs: man:cron(8)
Main PID: 1817000 (cron)
Tasks: 1 (limit: 153458)
Memory: 404.0K
CPU: 275ms
CGroup: /system.slice/cron.service
└─1817000 /usr/sbin/cron -f
Jan 07 11:30:01 pve CRON[1871738]: (root) CMD (tar czvf /pve-backup/pve-backup-$(date +)
Jan 07 11:30:01 pve CRON[1871737]: pam_unix(cron:session): session closed for user root
Jan 07 11:31:01 pve CRON[1873319]: pam_unix(cron:session): session opened for user root(uid=0) by (uid=0)
Jan 07 11:31:01 pve CRON[1873320]: (root) CMD (tar czvf /pve-backup/pve-backup-$(date +)
Jan 07 11:31:01 pve CRON[1873319]: pam_unix(cron:session): session closed for user root
Jan 07 11:32:01 pve CRON[1874858]: pam_unix(cron:session): session opened for user root(uid=0) by (uid=0)
Jan 07 11:32:01 pve CRON[1874859]: (root) CMD (tar czvf /pve-backup/pve-backup-$(date +)
Jan 07 11:32:01 pve CRON[1874858]: pam_unix(cron:session): session closed for user root
Jan 07 11:33:01 pve cron[1817000]: (root) RELOAD (crontabs/root)
Jan 07 11:35:01 pve cron[1817000]: (root) RELOAD (crontabs/root)
Jan 07 11:35:01 pve cron[1817000]: (root) RELOAD (crontabs/root)