Latest LQ Deal: Latest LQ Deals
Go Back > Forums > Linux Forums > Linux - General
User Name
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.


  Search this Thread
Old 03-30-2005, 04:44 AM   #1
Registered: Oct 2003
Posts: 249

Rep: Reputation: 30
script automatically add entry in cron daemon?


i just wanted to add some progs to the crontab but i need this to be done automatically
is there a command i can use to add an entry for the crontab without using crontab command
because using the crontab command, u have to edit the tab manually
but as said i want it to be done by a script

and the second question: when i add a crontab entry, when is it executed by the cron daemon?
i mean, if i change the crontab, and i want to execute a command every minute
when is it executed the first time?
updates the cron deamon itself every few minutes to know that new entrys are in the crontab?

Old 03-30-2005, 05:27 AM   #2
Registered: Sep 2003
Location: Bulgaria
Distribution: Ubuntu 9.10, FreeBSD 7.2
Posts: 459

Rep: Reputation: 31
I don't think you can edit the crontab file (/var/spool/cron/username in Slackware) without root privileges. As you can see the crontab app is suid root, so it can modify that file.. I'm sure there are scripts that use that crontab app (or other methods) to alter the configurations. And I'm sure there is a perl module about that (if you like perl).
If you are root you could change that file manualy with every text editor, but then you'll have to restart the crond with kill -1 <pid of crond>.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
shell script using /etc/cron.hourly to execute cron.php file? rioguia Programming 3 06-11-2008 08:09 AM
Cron Entry tor updatedb? Snump Mandriva 3 10-02-2004 05:37 AM
How can you get a script to add a cron to root's crons? bjdea1 Linux - General 6 09-09-2004 06:45 PM
how to make a cron entry? (perl) akaash Programming 2 05-06-2004 02:15 AM
Script thats add users automatically embalmedlenin *BSD 1 09-14-2003 04:34 PM > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 07:20 AM.

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