[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

How to setup a crontab?

Posted on 1998-06-21
6
Medium Priority
?
368 Views
Last Modified: 2010-04-21
Hi, i tried to run a crontab on my eggdrop, i did &
followed the btochk script, but when the system reboot the pid file stay in the library and the bot doesn't come back.
Help me setup it, maybe i have errors maybe my botchk bad. Thanks.
0
Comment
Question by:dima_sherman
6 Comments
 
LVL 1

Expert Comment

by:ragnar
ID: 2008105
type crontab -l and it will list what cron jobs are in the memory.  this might help you debug the problem.  i'm assuming you did the standard command

% crontab cronfile

where cronfile is the name of your cron commands?  hope this helps point you in the right direction.
0
 

Expert Comment

by:firefox032697
ID: 2008106
What is a bot / btochk?
What version of Unix?
Which library are you refering to is it the /proc (or equivalent) directory?

What process does the pid refer to? Is it a task called cron?

In short can you provide a little more detail?

Possibly the bot does not come back because the time that cron is told to schedule the task was either just before cron started or is well in to the future.

Typically cron is used to start background tasks at regular intervals (eg. Every Sunday night at 9PM). If you were wanting to start a job after a reboot, you might consider /etc/init.

Again, more details please?
0
 
LVL 2

Expert Comment

by:richrussell
ID: 2008107
Which version of UNIX?

Depending on version it can be as simple as adding script files to directories (cron_daily etc.).


0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:dima_sherman
ID: 2008108
NO NO NO, i did $ crontab 0,10,20,30,40,50 * * * *   /home/zer0c0ol/eggdrop1.1.5/botchk >/dev/null 2>&1
-------
Like it says in readme & botchk.
The bot comes back only if the IRC || the pipe broken or something.
If the system reboots the pid.LameBot stays and the comp think the
bot is online (i think so...)
0
 

Author Comment

by:dima_sherman
ID: 2008109
p.s there is no matter what Unix Os or system i know that crontab appears there. . . i have 10 diffrent unix oses i ask globally. thnaks.
0
 
LVL 3

Accepted Solution

by:
rjhawkin earned 100 total points
ID: 2008110
Try this,
Put a file in your home directory, for example 'cron-run'
edit cron-run with your favorite editor to contain the command that you want to run, exactly like you would type it on the command line. Just like a Shell Script:

#/bin/csh
/home/zer0c0ol/eggdrop1.1.5/botchk >/dev/null 2>&1


'chmod 700 cron-run'
make sure that '/home/zer0c0ol/eggdrop1.1.5/botchk' is 700 as well.
type 'crontab -e'

Into the temp file that opens, put your one line:


0,10,20,30,40,50 * * * * cron-run

Write the file and exit.

I believe cron assumes your home dir, but it been awhile sime I've set up any jobs.
Also depending on the version of *nix that the job will be running on you can replace 0,10,20,30,40,50   with  */10     meaning every 10th minute
See 'man 5 cron' for more information

0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Let's say you need to move the data of a file system from one partition to another. This generally involves dismounting the file system, backing it up to tapes, and restoring it to a new partition. You may also copy the file system from one place to…
This tech tip describes how to install the Solaris Operating System from a tape backup that was created using the Solaris flash archive utility. I have used this procedure on the Solaris 8 and 9 OS, and it shoudl also work well on the Solaris 10 rel…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Suggested Courses

873 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question