LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 08-07-2007, 03:55 AM   #1
edenCC
Member
 
Registered: May 2006
Location: China
Distribution: Debian
Posts: 198
Blog Entries: 1

Rep: Reputation: 32
how to make the cron file take effect[crontab]


Hi, list:

I'm running Redhat Linux; Usually I use this command to modify the crontab files:
crontab NewFileName

These days I found that if I use
'cat /tmp/cronfile > /var/spool/cron/root'
the 'cronfile' counld not take effect until reloading the daemon "crontd".

my question is:
any other ways to solve this except /restarting/reload/kill -HUP/ the crontd.

thanks for any directions,
sincerely,
 
Old 08-07-2007, 04:31 AM   #2
theYinYeti
Senior Member
 
Registered: Jul 2004
Location: France
Distribution: Arch Linux
Posts: 1,897

Rep: Reputation: 66
Cron jobs must always be changed with "crontab -e", not by changing the conf file directly. What you found is the simple consequence of not following this rule. I suppose "crontab -e" is just a simple 3-step command: edit, check, apply (restart daemon).

Much the same way, sudo rules are changed with "visudo", not be changing the sudoers file directly.

Yves.
 
Old 08-07-2007, 04:33 AM   #3
theYinYeti
Senior Member
 
Registered: Jul 2004
Location: France
Distribution: Arch Linux
Posts: 1,897

Rep: Reputation: 66
But then, maybe you have a special need that makes you think you cannot use "crontab -e"? Non-interactive maybe?
If this is the case, consider tweaking the EDITOR environment variable instead.

Yves.
 
Old 08-11-2007, 12:05 AM   #4
edenCC
Member
 
Registered: May 2006
Location: China
Distribution: Debian
Posts: 198

Original Poster
Blog Entries: 1

Rep: Reputation: 32
Thanks for you replay, but I dont quite agree with you.

=> Cron jobs must always be changed with "crontab -e", not by changing the conf file directly. What you found is the simple consequence of not following this rule. I suppose "crontab -e" is just a simple 3-step command: edit, check, apply (restart daemon).

At least, you can supply a cron file directly to 'crontab', and after both 'crontab -e' and 'crontab CronFile', changes will take effect at once. There is no need to restart crond.


=> Much the same way, sudo rules are changed with "visudo", not be changing the sudoers file directly.

Personally speaking, there is no daemon running for sudo, does it mean the configuration file is read only when 'sudo' is used?
The difference between 'visudo' and 'vi' maybe that:
the first one will do a syntax check, but the seond will not.
 
1 members found this post helpful.
  


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
cron not working from crontab nor form /etc/cron/cron.d. What did SuSE change? JZL240I-U SUSE / openSUSE 11 01-04-2007 01:57 AM
How to make a scheduled backup using cron file? mus1402 Linux - Newbie 3 02-04-2006 11:23 PM
How to make a scheduled backup procedure using the cron file? mus1402 Linux - Networking 1 02-04-2006 10:51 PM
Can I make a Cron job to synch/transfer a file from a folder to another FTP?... read efishta Linux - General 6 07-19-2003 10:03 PM
/etc/crontab adjustment not taking effect :-( furrie *BSD 4 10-08-2002 12:33 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 03:41 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