LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 01-12-2006, 05:58 PM   #1
microsoft/linux
Senior Member
 
Registered: May 2004
Location: Sebec, ME, USA
Distribution: Debian Etch, Windows XP Home, FreeBSD
Posts: 1,445
Blog Entries: 9

Rep: Reputation: 48
will this cron entry do what I want it to?


Ok, so my script is called 'fixresolv.conf' and is located in my home directory. I want it to run every 20 minutes, every day(when my computer is on, obviously it won't run if it's off).
I added the following to the /etc/crontab file
Code:
20 *    * * *  jake     /home/jake/fixresolv.conf
Will this do what I want it to?
 
Old 01-12-2006, 06:06 PM   #2
pljvaldez
LQ Guru
 
Registered: Dec 2005
Location: Somewhere on the String
Distribution: Debian Wheezy (x86)
Posts: 6,094

Rep: Reputation: 281Reputation: 281Reputation: 281
I think "20" would only run the script at 20 past the hour. You probably want "0,20,40".
 
Old 01-12-2006, 06:09 PM   #3
haertig
Senior Member
 
Registered: Nov 2004
Distribution: Debian, Ubuntu, LinuxMint, Slackware, SysrescueCD, Raspbian, Arch
Posts: 2,331

Rep: Reputation: 357Reputation: 357Reputation: 357Reputation: 357
No, that will run it at 20 after every hour. i.e., 1:20, 2:20, 3:20, etc.

Run "man -S 5 crontab" to see how to set it up.
 
Old 01-12-2006, 06:18 PM   #4
pljvaldez
LQ Guru
 
Registered: Dec 2005
Location: Somewhere on the String
Distribution: Debian Wheezy (x86)
Posts: 6,094

Rep: Reputation: 281Reputation: 281Reputation: 281
Interesting, I learned something new from that manpage. Also, I never did understand when at the bottom of a man page it said "also see cron(8), crontab(1)". I always thought, "hmmm. I just did man crontab, why do they want me to look at it again?" Thanks, haertig. I guess I should get a for that one.

Anyway, it looks like you could use */20 or 0,20,40...

Last edited by pljvaldez; 01-12-2006 at 06:20 PM.
 
Old 01-12-2006, 06:29 PM   #5
microsoft/linux
Senior Member
 
Registered: May 2004
Location: Sebec, ME, USA
Distribution: Debian Etch, Windows XP Home, FreeBSD
Posts: 1,445

Original Poster
Blog Entries: 9

Rep: Reputation: 48
Ok, I guess I missed that part. Yeah, after looking at it again, you guys are right. Thanks.
 
  


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
shell script using /etc/cron.hourly to execute cron.php file? rioguia Programming 3 06-11-2008 08:09 AM
script automatically add entry in cron daemon? Thinking Linux - General 1 03-30-2005 05:27 AM
Cron Entry tor updatedb? Snump Mandriva 3 10-02-2004 05:37 AM
how to make a cron entry? (perl) akaash Programming 2 05-06-2004 02:15 AM
hosts entry for a lan unit with no dns entry linxtc Linux - Networking 1 10-03-2003 08:05 AM

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

All times are GMT -5. The time now is 03:52 AM.

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