cron job

If you hit any installation issues or cannot connect to your freshly installed UnrealIRCd then this forum is for you.

Moderator: Supporters

Post Reply
Xander2024
Posts: 6
Joined: Sat Jul 20, 2024 10:47 am

cron job

Post by Xander2024 »

I set up the cron job as it says there (https://www.unrealircd.org/docs/Cron_job) but unfortunately it doesn't work.

*/5 * * * * /home/xxxx/xxxxx/unrealircd croncheck
@reboot /home/xxxxx/xxxx/unrealircd start croncheck
MAILTO=[email protected]

or

*/5 * * * * /home/xxxx/xxxxxx/unrealircd croncheck
@reboot /home/xxxx/xxxxxx/unrealircd croncheck
MAILTO=[email protected]
Valware
Official supporter
Posts: 46
Joined: Wed Mar 31, 2021 3:17 am
Location: Internet
Contact:

Re: cron job

Post by Valware »

The second one there looks correct. In what way do you mean it doesn't work? Did your server crash? Are you testing it and there was nothing after 5 minutes or reboot? Please explain further
Got an idea for a module? Don't be shy! Come talk to me on #unreal-support
Like the support I provide? Consider supporting me with a donation.
Valware
Official supporter
Posts: 46
Joined: Wed Mar 31, 2021 3:17 am
Location: Internet
Contact:

Re: cron job

Post by Valware »

Actually I think it may be slightly wrong.

It should be

Code: Select all

/home/user/unrealircd/unrealircd croncheck
It seems like you may have

Code: Select all

 /home/user/some_directory/unrealircd croncheck
so you should have

Code: Select all

/home/user/some_directory/unrealircd/unrealircd croncheck
For clarity, you must run the "unrealircd" script which is inside the "unrealircd" directory, so you just gotta call that instead of calling the directory itself :D
Got an idea for a module? Don't be shy! Come talk to me on #unreal-support
Like the support I provide? Consider supporting me with a donation.
Xander2024
Posts: 6
Joined: Sat Jul 20, 2024 10:47 am

Re: cron job

Post by Xander2024 »

Does not start after rebooting the server after 5 minutes. No matter whether /home/xxxx/xxxxx/unrealircd croncheck or /home/xxxx/xxxxxx/unrealircd start croncheck

If I run it manually, the cron starts, but not automatically.
It works manually via ./unrealircd croncheck
Valware
Official supporter
Posts: 46
Joined: Wed Mar 31, 2021 3:17 am
Location: Internet
Contact:

Re: cron job

Post by Valware »

I don't know what your xxxxx's mean and it would be easier to understand if you used obscure names like /some_directory/.

I'm sure you need to have this:

Code: Select all

/home/xxxx/xxxxx/unrealircd/unrealircd croncheck
instead of what you have which is
/home/xxxx/xxxxx/unrealircd croncheck
I believe you are missing an "/unrealircd"

It's my understanding that you are trying to call the "unrealircd" directory instead of the "unrealircd" file which is inside the "unrealircd" directory ;D
Got an idea for a module? Don't be shy! Come talk to me on #unreal-support
Like the support I provide? Consider supporting me with a donation.
Xander2024
Posts: 6
Joined: Sat Jul 20, 2024 10:47 am

Re: cron job

Post by Xander2024 »

sorry about the incomprehensible directory with xxx .
home/user/ircd/unrealircd croncheck.

ircd is the name of the folder unrealircd

hope it's better now :)
Valware
Official supporter
Posts: 46
Joined: Wed Mar 31, 2021 3:17 am
Location: Internet
Contact:

Re: cron job

Post by Valware »

indeed, it needs an extra /unrealircd on the end of it, like so:

Code: Select all

/home/user/ircd/unrealircd/unrealircd
Got an idea for a module? Don't be shy! Come talk to me on #unreal-support
Like the support I provide? Consider supporting me with a donation.
PeGaSuS
Official supporter
Posts: 103
Joined: Tue Jun 27, 2017 4:42 pm
Contact:

Re: cron job

Post by PeGaSuS »

Valware wrote: Sat Jul 20, 2024 12:12 pm indeed, it needs an extra /unrealircd on the end of it, like so:

Code: Select all

/home/user/ircd/unrealircd/unrealircd
There seems to be some miscommunication here.
We need to know the folder where the executable is placed.

During UnrealIRCd compilation, after the ./Config command, this question will appear:

Code: Select all

In what directory do you want to install UnrealIRCd?
(Note: UnrealIRCd 6 will need to be installed somewhere.
 If this directory does not exist it will be created.)
[/home/USER/unrealircd] ->
If we put /home/USER/ircd then the cronjob will need to be something like:

Code: Select all

*/5 * * * * /home/USER/ircd/unrealircd croncheck
If we put /home/USER/ircd/unrealircd then the cronjob will need to be something like:

Code: Select all

*/5 * * * * /home/USER/ircd/unrealircd/unrealircd croncheck
Now, we only need to know how UnrealIRCd was installed.
Because, if the folder was renamed after UnrealIRCd has been installed, this has harmful consequences.

My case:
I answered /home/USER/ircdz and my cronjob is set as the following:

Code: Select all

*/5 * * * * /home/USER/ircdz/unrealircd croncheck
So far, it works as expected. Can't test the reboot because I don't want to restart my computer :D
IRC Network: PTirc - GitHub: TehPeGaSuS - Help and support: #unreal-support
Xander2024
Posts: 6
Joined: Sat Jul 20, 2024 10:47 am

Re: cron job

Post by Xander2024 »

Code: Select all

In what directory do you want to install UnrealIRCd?
(Note: UnrealIRCd 6 will need to be installed somewhere.
 If this directory does not exist it will be created.)
[/home/USER/unrealircd] ->
My installation path:

Code: Select all

[/home/USER/unrealircd] ->/home/user/ircd
No idea if this is a mistake or something.

if I run the following in the ircd folder manuell:
./unrealircd croncheck
with the following entries in the cronjob

Code: Select all

/home/user/ircd/unrealircd/unrealircd croncheck
or
/home/user/ircd/unrealircd croncheck
Starts Unrealircd
PeGaSuS
Official supporter
Posts: 103
Joined: Tue Jun 27, 2017 4:42 pm
Contact:

Re: cron job

Post by PeGaSuS »

/home/user/ircd/unrealircd/unrealircd croncheck
or
/home/user/ircd/unrealircd croncheck
For your installation, your crontab must be:

Code: Select all

*/5 * * * * /home/USER/ircd/unrealircd croncheck
(replace USER with your shell username, obviously)

Are you saving the crontab properly?
Are you saving the crontab as the user running UnrealIRCd?
There's no # at the beginning of the line?
IRC Network: PTirc - GitHub: TehPeGaSuS - Help and support: #unreal-support
Xander2024
Posts: 6
Joined: Sat Jul 20, 2024 10:47 am

Re: cron job

Post by Xander2024 »

Am I wrong? You can only call crontab -e with root, right? If I'm wrong, then thanks for the improvement.

Even if it's not relevant to the topic, I'm very surprised and pleased with the new functions you've integrated. Keep up the good work.
PeGaSuS
Official supporter
Posts: 103
Joined: Tue Jun 27, 2017 4:42 pm
Contact:

Re: cron job

Post by PeGaSuS »

Xander2024 wrote: Sat Jul 20, 2024 1:25 pm Am I wrong? You can only call crontab -e with root, right? If I'm wrong, then thanks for the improvement.

Even if it's not relevant to the topic, I'm very surprised and pleased with the new functions you've integrated. Keep up the good work.
Yes, you're wrong. You should use crontab -e as the user running UnrealIRCd.
Otherwise you may mess up files permissions.
IRC Network: PTirc - GitHub: TehPeGaSuS - Help and support: #unreal-support
Xander2024
Posts: 6
Joined: Sat Jul 20, 2024 10:47 am

Re: cron job

Post by Xander2024 »

Your last question about crontab was saved correctly. That was my mistake, and the last answer was wrong. I finally got to my goal. THX
Thanks to everyone who tried to help.

The MAILTO... function gets the domain name from the host or hostname file when sending emails?
The email thing would be great.
Post Reply