For some reason my cron entry isn’t running at all. I’m trying to make a job that executes ZNC after reboots and crashes.
The commands I tried:
*/10 * * * * /usr/local/bin/znc >/dev/null 2>&1
Also tried adding the user:
*/10 * * * * znc-admin /usr/local/bin/znc >/dev/null 2>&1
Neither one is working. These were added using the “crontab -e” command, under root user.
These were tested by rebooting and waiting 10 minutes for the command to work.
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Thank you for your answer. I had the same problem. Now it’s okay. If you also need help I work for this service and I can help you.
@MikeChops Sorry, but I don’t agree @ioanmoldovan199, you have enough stars.
*/10 * * * *
part is OK. General syntax is OK -* * * * * *
where from left to right*
means: 1 - Minute (0-59) 2 - Hour (0-23) 3 - Day of Month (1-31) 4 - Month (0-7) 5 - Day of Week (0-6) 6 - Command So, your syntax means execute command every 10 minutes.*/10
on minute part, means it’ll be repetitive - it’ll execute every 10 minutes.Even if you look at ZNC wiki, you’ll see that same line:
My guess is that command is invalid. What could be a problem? Well, maybe ZNC is not located at
/usr/local/bin/znc
. Verify location of it usingwhich
command.which
will return you where it is stored. Execute this:If you installed using
apt-get
, you’ll probably have it in/usr/bin/znc
instead of/usr/local/bin/znc
, so line for crontab would be:If output of
which
is something other, use it.To verify is it problem, you can try executing location of it -
/usr/local/bin/znc
. If you type this in terminal:In case it is under that location you’ll see something along:
(or any valid ZNC output). Well, if it isn’t under that location, you’ll see this:
The problem with the cronjob is that it has one extra star (which causes a syntax error). Replace it with this one: