How to create Cron Jobs in Zpanel
August 23, 2014 / by Marco / Categories : Technology, WordpressI’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);
?>
chmod -R 777 /var/spool/cron
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.
Our Sponsors
- Advertise Me Pty Ltd
Digital Signage Solutions
OTHER ARTICLES YOU MAY LIKE
USING THIS AI TOO BOOST YOUR SOCIAL MEDIA GAME
A strong social media presence is essential for individuals and businesses alike. With the ever-growing number of users on various platforms, it can be daunting to stand out and create engaging content that captivates your audience. That’s where Marky comes in – a revolutionary tool that harnesses the power of artificial intelligence to help you […]
read moreHOW TO USE KATALIST AI TO CREATE AWESOME STORYBOARDS
Creating a compelling and visually appealing storyboard is crucial for any creative project, whether it’s a film, television show, or advertisement. However, the traditional process of storyboarding can be time-consuming and labor-intensive. That’s where Katalist AI comes in. This innovative tool combines the power of artificial intelligence with the creativity of human input to revolutionize […]
read more