LINUX.IE, website of the Irish Linux Users' Group
Tux rules!

   
Home
New Users
Articles
Download
Projects
Community
Vendors

  Print Version
Email to...
 
Archives:


planetILUG

Recent News

News Archive


Join the
ILUG
on FaceBook


Join the
ILUG
on LinkedIn


Join the
ILUG SETI
Group



















 
 :: Mailing Lists

[ILUG] Crontab

[ILUG] Crontab

Kenn Humborg kenn at linux.ie
Wed Feb 9 20:35:14 GMT 2000


On Wed, Feb 09, 2000 at 07:39:44PM +0000, ray at phbrink.ie wrote:
> On Wed, 9 Feb 2000, Johno Sullivan wrote:
> 
> |did you use "crontab -e" or "vi /etc/crontab"? 
> 
> This is going to depend on which distro you're using ?
> if one doesn't work try the other :)

The crontab command edits the files in /var/spool/cron,
not /etc/crontab.

> |On Wed, 9 Feb 2000 dollar at skynet.ie wrote:
> |
> |>I put this in my /etc/crontab:
> |>
> |>#switch internet on at:
> |>40 18 * * 1-5 /usr/sbin/ppp-go  <--- This brings up ppp0
> 
> try replacing it with the following so that the system knows who to run it 
> as for example 
> 40 18 * * 1-5 root /usr/sbin/ppp-go

That should solve it.  The /etc/crontab (and also files in /etc/cron.d
with newer versions of vixie-cron) must include a username in the 6th
field to specify the user to run the command as.  

Incidentally, I recommend putting site-specific entries in files
in /etc/cron.d, and leave the main /etc/crontab as supplied by your
distribution.  Files in /etc/cron.d have the same format as
/etc/crontab.  (You might need to duplicate the VAR= lines from 
the top of /etc/crontab.)  Note that this is very different from
the scripts (or symlinks) that are put in /etc/cron.{hourly,daily...}

> |>#switch internet off at:
> |>50 18 * * 1-5 killall pppd
> add a user for it to run as, also this could break if a path isn't
> declared b4hand, a good rule of thumb (IMHO) is to put absolute paths into
> crontabs.

Seconded.  Your $PATH is probably shorter than you'd expect under crond.
Just put in an entry to run /usr/bin/env and you'll get the cron environment
mailed to you.

> |>
> |>Then ran 
> |>
> |>/etc/rc.d/init.d/crond restart

No need to restart crond after changing a crontab.  crond reloads the
crontab automatically if it is modified.

Later,
Kenn





More information about the ILUG mailing list
Read this without the formatting.
                                                                                                    

 

Hosted by HEAnet


Maintained by the ILUG website team. The aim of Linux.ie is to support and help commercial and private users of Linux in Ireland. You can display ILUG news in your own webpages, read backend information to find out how. Networking services kindly provided by HEAnet, server kindly donated by Dell. Linux is a trademark of Linus Torvalds, used with permission. No penguins were harmed in the production or maintenance of this highly praised website. Looking for the Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!
RSS Version
Powered by Dell