This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

Crontab help

General support and discussion of Eggdrop bots.
Post Reply
R
Robot42
Voice
Posts: 13
Joined: Fri Aug 25, 2006 8:07 pm

Crontab help

Post by Robot42 »

Hi,

I recently got my eggdrop bot running. After a certain amount of time on the channel, the bot exits out automatically. I was thinking that this is because I haven't installed crontab in. I looked at the crontab guides, several actually, and I don't seem to understand what to do. I was hoping that someone would post step-by-step instructions on how to get crontab running. I tried the search function and found nothing.

Thanks.
User avatar
rosc2112
Revered One
Posts: 1454
Joined: Sun Feb 19, 2006 8:36 pm
Location: Northeast Pennsylvania

Post by rosc2112 »

Read 'man 1 crontab'

Assuming you're on a unix-type system and have crond actually running, you do:

crontab -e username (whatever username your bot's supposed to run as)

Then in the crontab file, you put something like:

0,5,10,15,20,25,30,35,40,45,50,55 * * * * /home/mybot/botchk >/dev/null 2>&1


This will run the botchk script every 5 minutes, and redirect the junk that cron will otherwise mail to you, to /dev/null.

As per the manpage for Dillon cron:

The crontab format is roughly similar to that used by vixiecron, but without complex features. Individual fields may contain a time, a time range, a time range with a skip factor, a symbolic range for the day of week and month in year, and additional subranges delimited with commas. Blank lines in the crontab or lines that begin with a hash (#) are ignored. If you specify both a day in the month and a day of week, the result is effectively ORd... the crontab entry will be run on the specified day of week and on the specified day in the month.

# MIN HOUR DAY MONTH DAYOFWEEK COMMAND
# at 6:10 a.m. every day
10 6 * * * date

# every two hours at the top of the hour
0 */2 * * * date

# every two hours from 11p.m. to 7a.m., and at 8a.m.
0 23-7/2,8 * * * date

# at 11:00 a.m. on the 4th and on every mon, tue, wed
0 11 4 * mon-wed date

# 4:00 a.m. on january 1st
0 4 1 jan * date

# once an hour, all output appended to log file
0 4 1 jan * date >>/var/log/messages 2>&1
R
Robot42
Voice
Posts: 13
Joined: Fri Aug 25, 2006 8:07 pm

Post by Robot42 »

So I type in: 0,5,10,15,20,25,30,35,40,45,50,55 * * * * /home/mybot/botchk >/dev/null 2>&1

Could you please show me an example of what it would look like.
User avatar
KrzychuG
Master
Posts: 306
Joined: Sat Aug 16, 2003 2:51 pm
Location: Torun, Poland
Contact:

Post by KrzychuG »

Use:

Code: Select all

*/5 * * * * /home/mybot/botchk >/dev/null 2>&1
It'll do the same but looks better ;)
Que?
User avatar
rosc2112
Revered One
Posts: 1454
Joined: Sun Feb 19, 2006 8:36 pm
Location: Northeast Pennsylvania

Post by rosc2112 »

Robot42 wrote:So I type in: 0,5,10,15,20,25,30,35,40,45,50,55 * * * * /home/mybot/botchk >/dev/null 2>&1

Could you please show me an example of what it would look like.
Uhm..it looks just like that.
R
Robot42
Voice
Posts: 13
Joined: Fri Aug 25, 2006 8:07 pm

Post by Robot42 »

I don't think it's doing anything because it keeps on exiting the channel after an hour or so.

[13:33:33] * Tyranitar (Tyranitar@disco.m1rc.net) Quit (Client exited)

That's what happens.
User avatar
DragnLord
Owner
Posts: 711
Joined: Sat Jan 24, 2004 4:58 pm
Location: C'ville, Virginia, USA

Post by DragnLord »

it's probably not working because the prior posts did not explain how to create the botchk file that they told you to crontab, small wonder it's not working

do the following to "botchk" file in the scripts directory:
  1. copy that file to the main eggdrop directory
  2. edit file to include paths relevant to your bot
  3. save file as bot.botchk
  4. chmod u+x bot.botchk
now you can crontab bot.botchk
R
Robot42
Voice
Posts: 13
Joined: Fri Aug 25, 2006 8:07 pm

Post by Robot42 »

For number 2, what parts would I edit? I see lines such as "/home/mydir/mybot" and "To check for your bot every 10 minutes, put the following line in your
# crontab:
# 0,10,20,30,40,50 * * * * /home/mydir/mybot/botchk
#"
User avatar
rosc2112
Revered One
Posts: 1454
Joined: Sun Feb 19, 2006 8:36 pm
Location: Northeast Pennsylvania

Post by rosc2112 »

DragnLord wrote:it's probably not working because the prior posts did not explain how to create the botchk file that they told you to crontab, small wonder it's not working
Came included with the eggdrop source archive.

cat /home/mybot/source/eggdrop1.6.18/README

$Id: README,v 1.44 2006-03-27 06:48:57 wcc Exp $

Readme
Last revised: June 5, 2002

Readme


Please at least SKIM this document before asking questions. In fact, READ IT if you've never successfully set up an Eggdrop bot before. PLEASE! READ IT!

Contents

<snip>
7. Setting up a crontab
7a. Setting up a crontab using autobotchk
<snip>
Post Reply