How to create Cron Jobs in Zpanel

August 23, 2014   /   by Marco  / Categories :  Technology, Wordpress

I’ve been using Zpanel for the past year and it’s a free Open Source Tool similar to Cpanel. Instead of paying $10 a month for using Cpanel, Zpanel is the free alternative. There are limited features with using Zpanel, for example it doesn’t have the option (One Click Install) to install WordPress, Joomla or the other open source packages. You need to do this manually. I found creaing Cron Jobs in Zpanel a little bit more difficult compared to Cpanel. But here’s what I had to do.

STEPS: CRON JOB IN ZPANEL

1. Create the php script. Here’s an example to trigger a php file hosted on your website:

<?php 
$sUrl = "http://www.businesslegions.com/script.php";
 
$rCh = curl_init($sUrl);
curl_setopt($rCh, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:11.0) Gecko Firefox/11.0");
curl_setopt($rCh, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($rCh, CURLOPT_NOBODY, 1);
curl_setopt($rCh, CURLOPT_CONNECTTIMEOUT, 0);
curl_setopt($rCh, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($rCh, CURLOPT_SSL_VERIFYHOST, false);
curl_exec($rCh);
curl_close($rCh);
?>
2. SSH to your server and create a folder under public_html called cron (this is just an example folder name) 3. Upload or save this file the file to /public_html/cron 4. Login to your Zpanel and click on Cron Manager Zpanel Cron Manager 5. Enter the location and name of the script, for example /public_html/cron/script.php Enter a comment or a description of the script 6. Select when the script will be executed. The options are: Every 1 minute Every 5 minutes Every 10 minutes Every 30 minutes Every 1 hour Every 2 hours Every 8 hours Every 12 hours Every 1 day Every week Every month Zpanel Cron Manager Script 7. Click create NOTE: If you run into a problem saying that the System Cron file could not be created then login to your server and issue this command:
chmod -R 777 /var/spool/cron
To check the cron jobs use the following command:
crontab -u apache -l

 ANOTHER ALTERNATIVE

I found that the php script that I use to trigger a website doesn’t really work when you execute a zpanel script. What I ended up doing is modifying the crontab script by using: crontab -u apache -e I deleted the commands that was generated by Zpanel and replaced it with my own

0,30 * * * * wget -q -O /dev/null “http://www.businesslegions.com/trigger”

If you are not sure about the timer settings then have a look at this reference guide: http://en.wikipedia.org/wiki/Cron

That’s it. If there’s anything that I missed please let me know.

DO YOU LIKE WHAT YOU'VE READ?
Join our subscription list and receive our content right in your mailbox. If you like to receive some Great deals our Freebies then subscribe now!

Our Sponsors

  • Follow us:

OTHER ARTICLES YOU MAY LIKE


STOP NOISY CALLS: THE ANDROID SETTING YOU SHOULD SWITCH ON TODAY

STOP NOISY CALLS: THE ANDROID SETTING YOU SHOULD SWITCH ON TODAY

Phone calls still matter. Whether you’re speaking to a client, checking in with family, or handling something urgent on the move, clarity can make or break the conversation. If you’ve ever found yourself apologising for the construction noise behind you, the wind across your microphone, or the café chatter muddling your words, there’s an Android […]

read more
FILMORA 15 – WHAT’S NEW? AI EXTEND, DYNAMIC CAPTIONS, TRUE TIMELINE EDITING + INSTALL GUIDE

FILMORA 15 – WHAT’S NEW? AI EXTEND, DYNAMIC CAPTIONS, TRUE TIMELINE EDITING + INSTALL GUIDE

There is a particular thrill to installing a major new release of your everyday editor, especially when your workflow is comfortable and productive in the current version. That feeling is right at the heart of the move from Filmora 14 to Filmora 15. This upgrade promises fresh creative features, faster handling of complex projects, and […]

read more

Like our Page