egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Crontab help

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Eggdrop Help
View previous topic :: View next topic  
Author Message
Robot42
Voice


Joined: 25 Aug 2006
Posts: 13

PostPosted: Fri Aug 25, 2006 8:14 pm    Post subject: Crontab help Reply with quote

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.
Back to top
View user's profile Send private message
rosc2112
Revered One


Joined: 19 Feb 2006
Posts: 1454
Location: Northeast Pennsylvania

PostPosted: Fri Aug 25, 2006 9:35 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
Robot42
Voice


Joined: 25 Aug 2006
Posts: 13

PostPosted: Sat Aug 26, 2006 1:21 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
KrzychuG
Master


Joined: 16 Aug 2003
Posts: 306
Location: Torun, Poland

PostPosted: Sat Aug 26, 2006 2:56 pm    Post subject: Reply with quote

Use:
Code:

*/5 * * * * /home/mybot/botchk >/dev/null 2>&1


It'll do the same but looks better ;)
_________________
Que?
Back to top
View user's profile Send private message Visit poster's website
rosc2112
Revered One


Joined: 19 Feb 2006
Posts: 1454
Location: Northeast Pennsylvania

PostPosted: Sat Aug 26, 2006 4:18 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
Robot42
Voice


Joined: 25 Aug 2006
Posts: 13

PostPosted: Sun Aug 27, 2006 5:10 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
DragnLord
Owner


Joined: 24 Jan 2004
Posts: 711
Location: C'ville, Virginia, USA

PostPosted: Sun Aug 27, 2006 7:45 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
Robot42
Voice


Joined: 25 Aug 2006
Posts: 13

PostPosted: Sun Aug 27, 2006 9:12 pm    Post subject: Reply with quote

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
#"
Back to top
View user's profile Send private message
rosc2112
Revered One


Joined: 19 Feb 2006
Posts: 1454
Location: Northeast Pennsylvania

PostPosted: Sun Aug 27, 2006 10:13 pm    Post subject: Reply with quote

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>
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Eggdrop Help All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber