LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 05-16-2011, 12:30 PM   #1
sylye
Member
 
Registered: Feb 2003
Location: Malaysia
Distribution: Mandrake 9.1, Debian 3.1,Centos 5.x,6.x,Slackware 13.37,14.0,14.1
Posts: 49

Rep: Reputation: 1
Cool 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
, and just
Code:
/usr/sbin/crond -l notice
will do, and somehow we still get log in /var/log/cron. Wonder where is the logging being done ?

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
* * * * * date >> /root/beta.log
the file was created earlier;
Code:
root@thinkphoenix:/etc/cron.d# ll beta
-rwxr-xr-x 1 root root 33 May 17 01:08 beta*
, but the crond only pick up this a bit later:
Code:
root@thinkphoenix:/etc/cron.d# cat /root/beta.log
Tue May 17 01:16:01 MYT 2011
Tue May 17 01:17:01 MYT 2011
Tue May 17 01:18:01 MYT 2011
Tue May 17 01:19:01 MYT 2011
My friends, any idea on how to make the cron job being execute the next minute I created it ? As you know there is no start/stop cron daemon script in slackware, so do I really need to kill the cron process and start it again everytime I created a new cron job for 13.37 ?

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 ?)
 
Old 05-16-2011, 06:32 PM   #2
ljb643
Member
 
Registered: Nov 2003
Posts: 526

Rep: Reputation: Disabled
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.
 
1 members found this post helpful.
Old 05-17-2011, 08:45 AM   #3
sylye
Member
 
Registered: Feb 2003
Location: Malaysia
Distribution: Mandrake 9.1, Debian 3.1,Centos 5.x,6.x,Slackware 13.37,14.0,14.1
Posts: 49

Original Poster
Rep: Reputation: 1
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
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
regarding crond m4manoze Linux - Newbie 8 03-09-2010 09:52 AM
crond use aloisius-a Slackware 3 11-18-2009 10:05 AM
crond.d sang_froid General 3 03-23-2009 10:23 AM
/sbin/service crond unable to start - gives permission error on /usr/sbin/crond mgervacio Linux - Newbie 6 07-16-2008 01:03 PM
Crond jimval7 Linux - General 2 03-06-2002 11:28 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 08:48 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration