By MikeChops
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.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
The problem with the cronjob is that it has one extra star (which causes a syntax error). Replace it with this one:
*/10 * * * /usr/local/bin/znc >/dev/null 2>&1
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:
*/10 * * * * /usr/local/bin/znc >/dev/null 2>&1
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 using which command. which will return you where it is stored. Execute this:
- which znc
Sample output of 'which'/usr/bin/znc
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:
*/10 * * * * /usr/bin/znc >/dev/null 2>&1
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:
- /usr/local/bin/znc
In case it is under that location you’ll see something along:
Sample output[ .. ] Checking for list of available modules...
[ >> ] ok
...
(or any valid ZNC output). Well, if it isn’t under that location, you’ll see this:
Sample output-bash: /usr/local/bin/znc: No such file or directory
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.