View previous topic :: View next topic |
Author |
Message |
NuLL3rr0r Tux's lil' helper
Joined: 13 Jul 2009 Posts: 96 Location: The Netherlands
|
Posted: Sat May 20, 2023 11:40 pm Post subject: dcron: failed parsing crontab for user root: PATH |
|
|
Interestingly it used to work for the root user but not anymore. It works for the user. For example, I have the following user with this crontab script which works:
Code: |
$ crontab -l
0 */4 * * * export DISPLAY=:0; /home/mamadou/.config/i3/reddit-wallpaper.sh > /dev/null 2>&1
|
And, for the user root, I have the following:
Code: |
crontab -l -u root
# zfs-auto-snapshot
*/15 * * * * root /usr/sbin/zfs-auto-snapshot zroot
|
Now, not only it won't work but also when I restart the dcron service I see the following in the logs:
Code: |
May 21 01:34:11 mamadou-legion crond[6826]: /usr/sbin/crond 4.5 dillon's cron daemon, started with loglevel notice
May 21 01:34:11 mamadou-legion crond[6826]: failed parsing crontab for user root: PATH="/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin"
|
Any idea where that is coming from? BTW, I did not run crontab /etc/crontab as instructed by the handbook, and have the following inside my /etc/crontab:
Code: |
$ cat /etc/crontab
# for dcron
# dcron:
# This is NOT the system crontab! dcron does not support a system crontab.
# to get /etc/cron.{hourly|daily|weekly|montly} working with dcron run
# crontab /etc/crontab
# as root.
# NOTE: This will REPLACE root's current crontab!!
# check scripts in cron.hourly, cron.daily, cron.weekly and cron.monthly
59 * * * * rm -f /var/spool/cron/lastrun/cron.hourly
9 3 * * * rm -f /var/spool/cron/lastrun/cron.daily
19 4 * * 6 rm -f /var/spool/cron/lastrun/cron.weekly
29 5 1 * * rm -f /var/spool/cron/lastrun/cron.monthly
|
EDIT: I have to mention I have this issue with two separate installations. |
|
Back to top |
|
|
alamahant Advocate
Joined: 23 Mar 2019 Posts: 3928
|
Posted: Sun May 21, 2023 8:47 am Post subject: |
|
|
This
Quote: |
*/15 * * * * root /usr/sbin/zfs-auto-snapshot zroot
|
might be ok for /etc/crontab.For the specific crontab of root it should be
Code: |
*/15 * * * * /usr/sbin/zfs-auto-snapshot zroot
|
_________________
|
|
Back to top |
|
|
NuLL3rr0r Tux's lil' helper
Joined: 13 Jul 2009 Posts: 96 Location: The Netherlands
|
Posted: Sun May 21, 2023 12:08 pm Post subject: |
|
|
Thank you very much for the suggestion. I tried it:
Code: |
$ crontab -l -u root
# zfs-auto-snapshot
*/15 * * * * /usr/sbin/zfs-auto-snapshot zroot
|
Though, still get the same error when I restart the dcron service:
Code: |
May 21 14:05:27 mamadou-legion crond[26028]: /usr/sbin/crond 4.5 dillon's cron daemon, started with loglevel notice
May 21 14:05:27 mamadou-legion crond[26028]: failed parsing crontab for user root: PATH="/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin"
|
|
|
Back to top |
|
|
alamahant Advocate
Joined: 23 Mar 2019 Posts: 3928
|
Posted: Tue May 23, 2023 9:53 am Post subject: |
|
|
Maybe it doesnt like the comment.
Plz remove
Code: |
# zfs-auto-snapshot
|
Also try
Code: |
ls -l /var/spool/cron/crontabs
|
Also maybe there are hidden characters in the file.Try deleting the file and running again
crontab -e
as root. _________________
|
|
Back to top |
|
|
The Main Man Veteran
Joined: 27 Nov 2014 Posts: 1172 Location: /run/user/1000
|
Posted: Mon Dec 16, 2024 4:09 pm Post subject: |
|
|
I don't know if OP solved this issue and how, but I am seeing the same thing, user jobs are still working fine, but for some reason root jobs are not (failed parsing crontab for user root...)
It worked for ages without any issues, having trouble figuring this one out, there were no config changes or anything like that, or related updates as far as I can tell. |
|
Back to top |
|
|
|