slackware 13.37 and crond
Hi all my slackware friends,
After installing 13.37 for a few weeks, I found out today there are some changes on how crond being handled in 13.37: i)in /etc/rc.d/rc.M, the log level has changed from '-l10' to '-l notice' ii)crond no longer need to explicitly pipe to /var/log/cron using Code:
/usr/sbin/crond -l10 >>/var/log/cron 2>&1 Code:
/usr/sbin/crond -l notice iii)there is a new folder /etc/cron.d/ Now the problem is, if I put anything in /etc/cron.d/ , the cron job wouldn't get noticed by the cron daemon, and it will waite for a long time before it run the new job. What I put just a simple /etc/cron.d/beta file and the content of it is: Code:
root@thinkphoenix:/etc/cron.d# cat beta Code:
root@thinkphoenix:/etc/cron.d# ll beta Code:
root@thinkphoenix:/etc/cron.d# cat /root/beta.log Any sharing and discussion will be greatly welcome. You can let me know how you think about this new cron approach as well in 13.37. (Or may be it's already in 13.1 and I didn't notice that ?) |
Hi,
crond (dcron) is the same in Slackware 13.37 as 13.1. /etc/cron.d is for "system cron tables" - really meant for use by packaged applications that need to create their own cron table. It gets scanned once an hour (same time crond scans the per-user crontab directory, just in case it missed something). That fits with what it is meant for. For other purposes, you probably want to use the "crontab" command which manages the per-user cron tables in /var/spool/cron. The command creates a file telling crond to rescan now, so you don't have the hour latency. On Slackware, your other option is /etc/cron.{hourly,daily,monthly,weekly}. Root can just drop scripts in there to run at the named interval. This can be easier than making up a crontab. The change from redirecting to syslog was probably an overdue fix. Crond by default logs to syslog, so the redirection probably didn't work anyway. Using "-l notice" is the same as "-l5". If you are seeing stuff in /var/log/cron using the default syslog reporting, it is because /etc/syslog.conf sends cron messages there. |
hi ljb643,
Thanks for taking your time to explain that for me, appreciated a lot :) So it's me who miss out there is already /etc/cron.d in 13.1.. And that folder is for application package wise cron job and it's not meant for immediate action, I see. So if I would like to have the cronjob works immediately I should have use 'root' to make the cronjob. And thanks about the detail elaboration on the cron log part, give a clearer picture. Overall, thanks for the feedback ;) |
All times are GMT -5. The time now is 11:56 AM. |