LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-26-2005, 01:06 PM   #1
nro
Member
 
Registered: Oct 2003
Distribution: Mandrake 9
Posts: 46

Rep: Reputation: 15
Using crontab in a bash script


Hello,
I have a bash script and would like to set a cron during the script execution. I have done research on 'crontab' and as far as I know, you can only edit the crontab file. Is there a command that I can use to insert a job into the crontab file?

Thanks,
Mike
 
Old 08-26-2005, 03:18 PM   #2
oblivious69
Member
 
Registered: May 2005
Distribution: debian
Posts: 79

Rep: Reputation: 15
if you know what you want to insert into the crontab, have the bash script make a call like:

Code:
echo "30 18 * * * /path/to/script" > whatevercrontab.file
This will put

Code:
30 18 * * * /path/to/script
into your whatevercrontab.file
 
Old 08-26-2005, 07:06 PM   #3
nro
Member
 
Registered: Oct 2003
Distribution: Mandrake 9
Posts: 46

Original Poster
Rep: Reputation: 15
How do I locate what file I am using? All I know is crontab -e which will simply bring up the editor.

Thanks,
Mike
 
Old 08-26-2005, 08:04 PM   #4
bosewicht
Senior Member
 
Registered: Aug 2003
Location: Houston, TX
Distribution: Arch
Posts: 1,381

Rep: Reputation: 47
what do you mean? locate the file....
whereis <file name>
slocate <filename>
 
  


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
Script having problem with Crontab DriveMeCrazy Programming 5 07-18-2005 03:29 PM
error running script on crontab haora Linux - Newbie 3 03-11-2005 04:02 PM
Script doesn't run in crontab dani81 Linux - General 1 11-16-2004 03:42 AM
crontab not finding script michaeln *BSD 4 08-22-2004 10:07 PM
bash script for database searching using crontab saurya_s Linux - Software 5 01-22-2004 08:53 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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