EggDrop crontab

The botchk script and crontab are used to automatically restart the bot if the shell it's on reboots or if the bot process is killed for some other reason. You can find the botchk file in the scripts directory (in the directory you installed the bot to). Newer versions of Eggdrop (from 1.3.24i) have a script included that automatically configures botchk and crontab for you. In telnet, simply switch to the scripts directory and type chmod 700 autobotchk then ./autobotchk <config> -dir /home/botdir -noemail, where /home/botdir is the directory you installed the bot to and <config> is the name you chose for your config file.

Otherwise, you can edit the botchk file and insert the required crontab entry manually. There are only four things you need to set in the botchk file, all of which are pretty self explanatory. Once you've edited the botchk file, you need to add an entry to your crontab. Here's the best method:

1) Your crontab line should look like:

# change this to the directory you run your bot from (capitalization COUNTS):
botdir="/home/sisrv/eggdrop"

# change this to the name of your bot's config file (capitalization COUNTS):
botscript="eggdrop.conf"

# change this to the botnet-nick of your bot (capitalization COUNTS):
botname="SiSrv"

# change this to the name of your bot's userfile (capitalization COUNTS):
userfile="SiSrv.user"

# change this to the name of your bot's pidfile (capitalization COUNTS):
pidfile="pid.SiSrv"

0,10,20,30,40,50 * * * * /home/sisrv/eggdrop/scripts/botchk >/dev/null 2>&1

This will run the botchk script every 10 minutes, which checks that the bot is running and restarts it if it isn't. You just need to change the /home/botdir part to the correct path to the bot on your shell (type pwd to show this). Type the line in Notepad or some place where you can highlight and copy it from.

2) Type crontab -e. This should bring up the vi editor (it will appear as a bunch of lines starting with the ~ character), but may open up the pico editor instead.

3) For vi, do the following - hit ctrl-L, hit i, paste the crontab line you created earlier, hit Esc, type :wq! then hit Enter (if you make a mistake doing this, just hit Esc and start over). For pico - paste the crontab line you created earlier, hit ctrl-X, hit Y when prompted to save, hit Enter when prompted for a filename.

You can view your current crontab entries by typing crontab -l. To clear your crontab, use crontab -r (may be crontab -d on some shells).

If for whatever reason the above cron is not working, try the second easier solution:

Auto starting Eggdrop

Systems go down from time to time, taking your Eggdrop along with it. You may not be not around to restart it manually, so you can instead use features of the operating system to automatically restart Eggdrop should it quit for any reason. Eggdrop comes with an autobotchk shell script that can create either a systemd or crontab entry. The systemd option will monitor your Eggdrop and a) start it when the machine boots and b) restart the Eggdrop if it crashes for any reason. The (older) crontab option will check (by default) every 10 minutes to see if your Eggdrop is still running, and attempt to restart it if it is not.

To auto-generate a systemd job, from the Eggdrop install directory, simply run:

./scripts/autobotchk <Eggdrop config file name> -systemd

To auto-geneerate a script to check Eggdrop’s status and run it via a crontab entry, simply run:

./scripts/autobotchk <Eggdrop config file>

This will crontab your bot using the default setup. If you want a list of autobotchk options, type ‘./autobotchk’. A crontab example with options would be, cd eggdrop or the name of your bots directory

./scripts/autobotchk <Eggdrop config file> -noemail -5
./scripts/autobotchk eggdrop.conf -noemail -5

If you have installed your eggdrop in custom path i.e infobot and you use custom name i.e infobot.conf, than you should:

cd infobot
./scripts/autobotchk infobot.conf -noemail -5

This would setup crontab to run the botchk every 5 minutes and not send you an email saying that it restarted your bot and you should see this output:

Opening 'eggdrop.conf' for processing ... done
Scanning the config file ... done
Wrote 'SiSrv.botchk' successfully (2293 bytes)

That's all, enjoy your bot.

  • eggdrop crontab
  • 132 کاربر این را مفید یافتند
آیا این پاسخ به شما کمک کرد؟

مقالات مربوطه

UnrealIRCd crontab

UnrealIRCd crontab If you want to make sure that UnrealIRCd starts on system startup (or...

Anope Services crontab

Setting up a crontab A crontab entry will allow you to check periodically whether Anope is still...

About cronjob

The crontab is a list of commands that you want to run on a regular schedule, and also the name...

psyBNC Crontab

When your server stops working and you must reboot it, the psyBNC cant start automatically. But...

BOPM Crontab

#!/bin/sh # # Blitzed Open Proxy Monitor Crontab Script - Restart BOPM if needed. # # From...

Powered by WHMCompleteSolution