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.

psybnc auto restart

Old posts that have not been replied to for several years.
S
Sphinx
Halfop
Posts: 90
Joined: Tue Mar 04, 2003 10:00 am

psybnc auto restart

Post by Sphinx »

i know eggdrop can do this with crontab
but is there something for psybnc that auto restarts when the shell was down for restart or other stuff ?
User avatar
j0n
Op
Posts: 140
Joined: Wed May 07, 2003 5:31 pm
Location: sjn.nb.ca
Contact:

Post by j0n »

http://www.netknowledgebase.com/tutorials/psybnc.html#2

Setting Crontab
The basic form for a crontab entry is (to the best of my knowledge):
<minute> <hour> <day> <week> <month> <process to run>

So, if you like to check every 10min, it would be:

0,10,20,30,40,50 * * * * /path/to/my/process
Included with psybnc is psybncchk. Open this file and change the line that reads PSYBNCPATH=/set/path/here. Set it to your psybnc directory of course. Make sure this file has execute perms; in your shell, type:

chmod 700 psybncchk
Then add the following to your crontab (use crontab -e to edit your crontab): (this example is for a check every 10 minutes:

0,10,20,30,40,50 * * * * /l33t/shell/psybnc/psybncchk >/dev/null 2>&1
The >/dev/null 2>&1 part tells crontab not to send you an e-mail whenever it restarts psybnc. Omit that part if you like e-mail.
S
Sphinx
Halfop
Posts: 90
Joined: Tue Mar 04, 2003 10:00 am

Post by Sphinx »

thanks gonna give it a try
S
Sphinx
Halfop
Posts: 90
Joined: Tue Mar 04, 2003 10:00 am

Post by Sphinx »

hmm weird cant get it to work when i do
0,5,10,15,20,25 * * * * /home/clas
sic/path/to/Bouncers/psybnc/psybncchk >/dev/null 2>&1

it does nothing
any idea what i do wrong ?
p
ppslim
Revered One
Posts: 3914
Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England

Post by ppslim »

Yes, you need to mke sure you change the path and filename to reflect your setuIt isn't majic, it doesn't look for the file to execute, you have to tell it.
S
Sphinx
Halfop
Posts: 90
Joined: Tue Mar 04, 2003 10:00 am

Post by Sphinx »

i dont know but this is my path from the bnc

/home/classic/ilumination/Bouncers/efnet/psybnc/

so

0,5,10,15,20,25 * * * * /home/clas
sic/ilumination/Bouncers/efnet/psybnc/psybncchk >/dev/null 2>&1

should work no ?
p
ppslim
Revered One
Posts: 3914
Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England

Post by ppslim »

Yes, if the following is true.

1: home/classic/ilumination/Bouncers/efnet/psybnc/ is the path to the psybnc

2: psybncchk is the the name of the file

3: You have set the file executable as noted in the instructions above.

Note, it should not be on 2 lines, and only on 1.
S
Sphinx
Halfop
Posts: 90
Joined: Tue Mar 04, 2003 10:00 am

Post by Sphinx »

hmm weird no idea what i do wrong the since
0,5,10,15,20,25 * * * * /home/classic/ilumination/Bouncers/efnet/psybnc/psybncchk >/dev/null 2>&1

wont work at all
p
ppslim
Revered One
Posts: 3914
Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England

Post by ppslim »

What error does it give.
S
Sphinx
Halfop
Posts: 90
Joined: Tue Mar 04, 2003 10:00 am

Post by Sphinx »

no error at all

ilumination@Statler:~/Bouncers/efnet/psybnc$ sic/ilumination/Bouncers/efnet/psy
bnc/psybncchk >/dev/null 2>&1
ilumination@Statler:~/Bouncers/efnet/psybnc$

that what i get i enter the command then it just gives me a new line to enter a command so no error or no starting note like for a eggdrop
p
ppslim
Revered One
Posts: 3914
Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England

Post by ppslim »

LOL, partly our fault.

Remove the >/dev/null 2>&1 from the end.

These are used to direct all output from the script the *nix pit of doom, IE, to be never seen again.

This is used in crontab to prevent it sending you e-mails.

Remove these to test the script before entering it into the crontab. If it works, then place it in the crontab.

Check your e-mail, to see if it works.

If it then works, you can place the ">/dev/null 2>&1" back.
S
Sphinx
Halfop
Posts: 90
Joined: Tue Mar 04, 2003 10:00 am

Post by Sphinx »

lol well i never expected to have this much trouble with just starting the damn crontab

but still no luck without the dev part

ilumination@Statler:~/Bouncers/efnet/psybnc$ /Bouncers/efnet/psybnc$ sic/ilumination/Bouncers/efnet/psybnc/psybncchk
bash: /Bouncers/efnet/psybnc$: No such file or directory
p
ppslim
Revered One
Posts: 3914
Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England

Post by ppslim »

Read the error.

It states the files you are pointing at doesn't exist.
S
Sphinx
Halfop
Posts: 90
Joined: Tue Mar 04, 2003 10:00 am

Post by Sphinx »

yeah i know but i assume it means psybncchk but that file does it excist in that directory
S
Sphinx
Halfop
Posts: 90
Joined: Tue Mar 04, 2003 10:00 am

Post by Sphinx »

this is what i did

i opened the psybncchk file and change the path
PSYBNCPATH=/...
to
PSYBNCPATH=/home/classic/ilumination/Bouncers/efnet/psybnc

then i did chmod 700 psybncchk

after that

0,5,10,15,20,25 * * * * /home/classic/ilumination/Bouncers/efnet/psybnc/psybncchk >/dev/null 2>&1

which did nothing

when i tried

0,5,10,15,20,25 * * * * /home/classic/ilumination/Bouncers/efnet/psybnc/psybncchk

it gave me

bash: 0,10,20,30,40,50: command not found

so i followed it like it said in the guide
but still it does not work and the filename excists in the directory
Locked