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.

znc

Help with usage of shell accounts and bouncers.
Post Reply
User avatar
abah
Halfop
Posts: 89
Joined: Sun Dec 01, 2013 3:04 am
Location: Indonesia

znc

Post by abah »

How to make crontab for znc
abah - Kota Makassar - Indonesia
User avatar
CrazyCat
Revered One
Posts: 1339
Joined: Sun Jan 13, 2002 8:00 pm
Location: France
Contact:

Re: znc

Post by CrazyCat »

Usually you don't need any crontab for znc as they are working as service, or in background.

Can you explain what you try to do ?
User avatar
aslpls
Halfop
Posts: 66
Joined: Mon May 02, 2016 9:41 am

Re: znc

Post by aslpls »

abah wrote: Thu Nov 28, 2024 10:45 am How to make crontab for znc
hey abah, check this link maybe it helps. scroll down to find the crontab.

https://wiki.ircnow.org/index.php?n=Znc.Install
It was FUNNY!
User avatar
Carlin0
Halfop
Posts: 49
Joined: Tue Dec 04, 2018 3:41 pm
Location: Italy

Re: znc

Post by Carlin0 »

"From the diamonds nothing is born, from the manure the flowers are born ..."
--- F. De Andrè ---
User avatar
abah
Halfop
Posts: 89
Joined: Sun Dec 01, 2013 3:04 am
Location: Indonesia

Re: znc

Post by abah »

Carlin0 wrote: Sat Nov 30, 2024 10:49 am From ZNC's official wiki
thanks work for me
abah - Kota Makassar - Indonesia
n
nobody
Voice
Posts: 31
Joined: Fri Apr 03, 2020 10:01 pm

Re: znc

Post by nobody »

Let us familiarized the value of crontab schedule:

Code: Select all

┌───────────── minute (0 - 59)
│ ┌───────────── hour (0 - 23)
│ │ ┌───────────── day of the month (1 - 31)
│ │ │ ┌───────────── month (1 - 12)
│ │ │ │ ┌───────────── day of the week (0 - 7) (Sunday is 0 or 7)
│ │ │ │ │
* * * * *  <command to run>
here's some example of crontab for znc:

1. # Crontab entry to restart ZNC at midnight every day (which I personally use)

Code: Select all

(crontab -l 2>/dev/null; echo "0 0 * * * /usr/bin/znc -r") | crontab -
2. # adding znc in startup (after system restart/reboot)

Code: Select all

@reboot /usr/bin/znc
3. # it will rerun after 5 minutes

Code: Select all

*/5 * * * * /usr/bin/znc 
4. # At the top of every hour

Code: Select all

0 * * * *  /usr/bin/znc


note: Use

Code: Select all

* * * * * /usr/bin/znc
carefully — if your script is heavy or has side effects, it could overload the system by running every minute.

#edited as pointed out by @CrazyCat ( from znc to /usr/bin/znc - full path )
Last edited by nobody on Sun Apr 13, 2025 6:33 pm, edited 1 time in total.
ₙₒₜₕᵢₙg ᵢₛ ₕₐᵣₘ ₑₓcₑₚₜ yₒᵤᵣ ₚᵣᵢdₑ ☢ [ ᴇxᴘʟᴏɪᴛᴇʀ ] ☢
https://www.blackbug.org
User avatar
CrazyCat
Revered One
Posts: 1339
Joined: Sun Jan 13, 2002 8:00 pm
Location: France
Contact:

Re: znc

Post by CrazyCat »

Just a small tip: don't use "znc" and prefer "/usr/bin/znc"

crontab works without user logged, so env is not loaded, especially $PATH. So crontab may not found where znc is. If you give the full path, there is no trouble.
n
nobody
Voice
Posts: 31
Joined: Fri Apr 03, 2020 10:01 pm

Re: znc

Post by nobody »

CrazyCat wrote: Sun Apr 13, 2025 6:56 am Just a small tip: don't use "znc" and prefer "/usr/bin/znc"

crontab works without user logged, so env is not loaded, especially $PATH. So crontab may not found where znc is. If you give the full path, there is no trouble.


Thank you - I edited my post
ₙₒₜₕᵢₙg ᵢₛ ₕₐᵣₘ ₑₓcₑₚₜ yₒᵤᵣ ₚᵣᵢdₑ ☢ [ ᴇxᴘʟᴏɪᴛᴇʀ ] ☢
https://www.blackbug.org
w
willyw
Revered One
Posts: 1209
Joined: Thu Jan 15, 2009 12:55 am

Re: znc

Post by willyw »

nobody wrote: Sun Apr 13, 2025 3:43 am Let us familiarized the value of crontab schedule:
[...]
Which reminded me of something. Long ago, I stumbled onto a website somehow. It is so useful, that I still use it ! :)

https://crontab.guru/

See the part near the center " 5 4 * * * " that is inside a lighter colored oval? Just click on a value, and you can change it. You'll see.



I hope that this is helpful to somebody, someday.
For a fun (and popular) Trivia game, visit us at: irc.librairc.net #science-fiction . Over 300K Q & A to play in BogusTrivia !
Post Reply