Cronjob question

bfish2

Member
Mar 28, 2023
14
0
6
I have a command in crontab -e to run nightly:

tar czvf /mnt/pve/NAS_Storage/host_bu/proxmox03-backup-$(date +%F).tar.gz /etc/pve

It is not producing the output.

When i look at the journal I see

1742327538451.png

which is essentially the command WITHOUT /etc/pve at the end, which is the source directory being copied.

What does that mean is wrong?

Thanks in advance!
 
There are likely two issues:
a) % is a special character in crontab (man 5 crontab) https://linux.die.net/man/5/crontab#:~:text=are not allowed.-,The,-"sixth" field (the
b) you are having issues with PATH https://forum.proxmox.com/threads/b...p-based-on-status-crontab.143845/#post-646704



Blockbridge : Ultra low latency all-NVME shared storage for Proxmox - https://www.blockbridge.com/proxmox
Thank you! You led me in the right direction.

What is needed is a backslash in front of the % tomake the % be taken literally and NOT as a "new line":

0 0 * * * tar czvf /mnt/pve/NAS_Storage/host_bu/proxmox01-backup-$(date +\%F).tar.gz /etc/pve