| View previous topic :: View next topic |
| Author |
Message |
Robot42 Voice
Joined: 25 Aug 2006 Posts: 13
|
Posted: Fri Aug 25, 2006 8:14 pm Post subject: Crontab help |
|
|
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 |
|
 |
rosc2112 Revered One

Joined: 19 Feb 2006 Posts: 1454 Location: Northeast Pennsylvania
|
Posted: Fri Aug 25, 2006 9:35 pm Post subject: |
|
|
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 |
|
 |
Robot42 Voice
Joined: 25 Aug 2006 Posts: 13
|
Posted: Sat Aug 26, 2006 1:21 pm Post subject: |
|
|
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 |
|
 |
KrzychuG Master

Joined: 16 Aug 2003 Posts: 306 Location: Torun, Poland
|
Posted: Sat Aug 26, 2006 2:56 pm Post subject: |
|
|
Use:
| Code: |
*/5 * * * * /home/mybot/botchk >/dev/null 2>&1
|
It'll do the same but looks better ;) _________________ Que? |
|
| Back to top |
|
 |
rosc2112 Revered One

Joined: 19 Feb 2006 Posts: 1454 Location: Northeast Pennsylvania
|
Posted: Sat Aug 26, 2006 4:18 pm Post subject: |
|
|
| 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 |
|
 |
Robot42 Voice
Joined: 25 Aug 2006 Posts: 13
|
Posted: Sun Aug 27, 2006 5:10 pm Post subject: |
|
|
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 |
|
 |
DragnLord Owner

Joined: 24 Jan 2004 Posts: 711 Location: C'ville, Virginia, USA
|
Posted: Sun Aug 27, 2006 7:45 pm Post subject: |
|
|
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:
- copy that file to the main eggdrop directory
- edit file to include paths relevant to your bot
- save file as bot.botchk
- chmod u+x bot.botchk
now you can crontab bot.botchk |
|
| Back to top |
|
 |
Robot42 Voice
Joined: 25 Aug 2006 Posts: 13
|
Posted: Sun Aug 27, 2006 9:12 pm Post subject: |
|
|
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 |
|
 |
rosc2112 Revered One

Joined: 19 Feb 2006 Posts: 1454 Location: Northeast Pennsylvania
|
Posted: Sun Aug 27, 2006 10:13 pm Post subject: |
|
|
| 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 |
|
 |
|
|
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
|
|