New in CWP Edge / LTSFree with every CWPpro licenceWebsites up to 300x faster

CWP now includes LSPHP, LSAPI-Cache and CWP Cage at no extra cost with all CWPpro licences. The LSAPI-Cache plugin is integrated into our WordPress and other script installers. Available now in the Edge-Latest and LTS-Stable versions. Discuss in the forum

LSPHP / Cache ›
CWP Secure KernelKernel-level protectionEvery site in its own sandbox

Every PHP site, cron job and SSH session runs in its own profile that the kernel enforces. A hacked WordPress cannot read other accounts’ files, and crypto miners and unexpected processes are stopped. Discuss in the forum

Secure Kernel ›
CWP DataCenter PanelFree for CWPpro serversAll your servers on one screen

Manage all your CWP servers from one panel: live health, every hosting account, CWP and OS updates on many servers at once, backups, SSL, firewall and Telegram alerts. Discuss in the forum

DataCenter Panel ›
CWP Backup ServerFree for CWPpro serversBackups that ransomware cannot reach

Protected backups of all your CWP servers on a separate machine. Snapshots a hosting server cannot delete, and restore of files, databases, mail and whole accounts in the admin and user panel. Discuss in the forum

Backup Server ›
WordPress ManagerIncluded & freeWordPress managed from the panel

Install, secure, update, back up and clone WordPress sites without FTP. Updates are tested on a staging clone first and applied to the live site only when they pass, with a backup taken first. Discuss in the forum

WordPress Manager ›
CWP CageIsolationEvery account in its own cage

Per-account isolation built from Linux namespaces and cgroups. A break-in or a runaway script on one site cannot reach another account, the panel or the rest of the server; resource limits per hosting package. Discuss in the forum

CWP Cage ›
Script InstallerOne-click appsWordPress, Joomla, Moodle and more in one click

CWP’s own script installer in the user panel: pick an app, choose the domain and folder, and it is live in seconds with its database and admin login created automatically. Ready for LSPHP and LSAPI-Cache. Discuss in the forum

Script Installer ›
DNS ClusterFor every control panelOne DNS cluster for all your servers

Your servers keep creating domains as usual; the zones are collected into one authoritative PowerDNS cluster you control, with DNSSEC, roles and a full activity trail. Accepts CWP, cPanel, Plesk, DirectAdmin and BIND. Discuss in the forum

DNS Cluster ›
CWP BillingFree to useBilling and support system for hosting providers

Clients, services, invoices, payments, domains, server provisioning and support tickets in one place. All gateways, server modules and registrars are free, with free migration from WHMCS, ClientExec and Blesta. Discuss in the forum

CWP Billing ›
CWPproFrom $1.49 per monthEvery CWP feature unlocked

CWPpro is the professional version of Control Web Panel: all features, unlimited accounts, the latest CWP version and security fixes first. $1.49 per month or $11.99 per year. Discuss in the forum

Get CWPpro ›

Crontab will not work

Started by alebal, August 19, 2016, 05:32:45 PM

Previous topic - Next topic

alebal

Hello to all.

For each of my site I have a php file to be launched once a week via crontab.
This is the code I use
0 18 * * 3 /usr/local/bin/php -q /home/pornupda/public_html/mio-sito.com/cronojob.php

Why it does not work? It never starts ..
If you launch the file manually everything works perfectly.
I saw several threads on this forum seems to be the correct address.
So why it does not work?

Igor S.

Hello.

If your command:
/usr/local/bin/php -q /home/pornupda/public_html/mio-sito.com/cronojob.php 
works fine, it will works with crontab too.
Try remove '-q' key, add and test it like:
* * * * * /usr/local/bin/php /home/pornupda/public_html/mio-sito.com/cronojob.php



You can ask me to solve any problem with your server for some money in pm  ;)






Services Monitoring & RBL Monitoring
http://centos-webpanel.com/services-monitor


Join our Development Team and get paid !
http://centos-webpanel.com/develope-modules-for-cwp

Installation Instructions
http://centos-webpanel.com/installation-instructions

Get Fast Support Here
http://centos-webpanel.com/support-services

alebal

Does not work...

These are the log. There you see something strange ???

Aug 21 00:00:01 centos-1gb-blr1-01 CROND[29994]: (root) CMD (/usr/sbin/csf --lfd restart > /dev/null 2>&1)
Aug 21 00:00:01 centos-1gb-blr1-01 CROND[29995]: (root) CMD (/usr/local/bin/svcMonitor)
Aug 21 00:01:01 centos-1gb-blr1-01 CROND[30523]: (root) CMD (run-parts /etc/cron.hourly)
Aug 21 00:01:01 centos-1gb-blr1-01 run-parts(/etc/cron.hourly)[30523]: starting 0anacron
Aug 21 00:01:01 centos-1gb-blr1-01 anacron[30532]: Anacron started on 2016-08-21
Aug 21 00:01:01 centos-1gb-blr1-01 run-parts(/etc/cron.hourly)[30534]: finished 0anacron
Aug 21 00:01:01 centos-1gb-blr1-01 anacron[30532]: Jobs will be executed sequentially
Aug 21 00:01:01 centos-1gb-blr1-01 anacron[30532]: Normal exit (0 jobs run)
Aug 21 00:20:01 centos-1gb-blr1-01 CROND[328]: (root) CMD (/usr/local/cwp/php54/bin/php -d max_execution_time=1000000 -q /usr/local/cwpsrv/htdocs/resources/admin/include/cron.php > /dev/null 2>&1)
Aug 21 01:00:01 centos-1gb-blr1-01 CROND[5144]: (root) CMD (/usr/local/bin/svcMonitor)
Aug 21 01:00:01 centos-1gb-blr1-01 CROND[5145]: (root) CMD (/usr/sbin/raid-check)
Aug 21 01:01:01 centos-1gb-blr1-01 CROND[5712]: (root) CMD (run-parts /etc/cron.hourly)
Aug 21 01:01:01 centos-1gb-blr1-01 run-parts(/etc/cron.hourly)[5712]: starting 0anacron
Aug 21 01:01:01 centos-1gb-blr1-01 anacron[5721]: Anacron started on 2016-08-21
Aug 21 01:01:01 centos-1gb-blr1-01 run-parts(/etc/cron.hourly)[5723]: finished 0anacron
Aug 21 01:01:01 centos-1gb-blr1-01 anacron[5721]: Jobs will be executed sequentially
Aug 21 01:01:01 centos-1gb-blr1-01 anacron[5721]: Normal exit (0 jobs run)
Aug 21 02:00:01 centos-1gb-blr1-01 CROND[14245]: (root) CMD (/usr/local/bin/svcMonitor)
Aug 21 02:01:01 centos-1gb-blr1-01 CROND[14698]: (root) CMD (run-parts /etc/cron.hourly)
Aug 21 02:01:01 centos-1gb-blr1-01 run-parts(/etc/cron.hourly)[14698]: starting 0anacron
Aug 21 02:01:01 centos-1gb-blr1-01 anacron[14707]: Anacron started on 2016-08-21
Aug 21 02:01:01 centos-1gb-blr1-01 run-parts(/etc/cron.hourly)[14709]: finished 0anacron
Aug 21 02:01:01 centos-1gb-blr1-01 anacron[14707]: Jobs will be executed sequentially
Aug 21 02:01:01 centos-1gb-blr1-01 anacron[14707]: Normal exit (0 jobs run)
Aug 21 03:00:01 centos-1gb-blr1-01 CROND[21114]: (root) CMD (/usr/local/bin/svcMonitor)
Aug 21 03:01:01 centos-1gb-blr1-01 CROND[21582]: (root) CMD (run-parts /etc/cron.hourly)
Aug 21 03:01:01 centos-1gb-blr1-01 run-parts(/etc/cron.hourly)[21582]: starting 0anacron
Aug 21 03:01:01 centos-1gb-blr1-01 anacron[21591]: Anacron started on 2016-08-21
Aug 21 03:01:01 centos-1gb-blr1-01 run-parts(/etc/cron.hourly)[21593]: finished 0anacron
Aug 21 03:01:01 centos-1gb-blr1-01 anacron[21591]: Will run job `cron.daily' in 27 min.
Aug 21 03:01:01 centos-1gb-blr1-01 anacron[21591]: Will run job `cron.weekly' in 47 min.
Aug 21 03:01:01 centos-1gb-blr1-01 anacron[21591]: Jobs will be executed sequentially
Aug 21 03:28:01 centos-1gb-blr1-01 anacron[21591]: Job `cron.daily' started
Aug 21 03:28:01 centos-1gb-blr1-01 run-parts(/etc/cron.daily)[25967]: starting certwatch
Aug 21 03:28:01 centos-1gb-blr1-01 run-parts(/etc/cron.daily)[25977]: finished certwatch
Aug 21 03:28:01 centos-1gb-blr1-01 run-parts(/etc/cron.daily)[25967]: starting cwp
Aug 21 03:28:16 centos-1gb-blr1-01 run-parts(/etc/cron.daily)[26102]: finished cwp
Aug 21 03:28:16 centos-1gb-blr1-01 run-parts(/etc/cron.daily)[25967]: starting logrotate


My test crontab was reduced to sending a mail ... but the email never arrives ...
CWP is on droplet digitalocean, digitalocean can create problems to the crontab?

alebal

No, I want to use the server crontab. Why should I use an external service? for a fee. It is stupid.

alebal

If I type via ssh crontab -e, this is the result

~
"/tmp/crontab.7Z7B4W" 0L, 0C



But it is normal ??

Igor S.

Quote from: alebal on August 22, 2016, 08:27:58 PM
If I type via ssh crontab -e, this is the result

~
"/tmp/crontab.7Z7B4W" 0L, 0C



But it is normal ??


Yes, it's normal. Crontab using some tmp file while you writing the job.



You can ask me to solve any problem with your server for some money in pm  ;)






Services Monitoring & RBL Monitoring
http://centos-webpanel.com/services-monitor


Join our Development Team and get paid !
http://centos-webpanel.com/develope-modules-for-cwp

Installation Instructions
http://centos-webpanel.com/installation-instructions

Get Fast Support Here
http://centos-webpanel.com/support-services

Igor S.

Quote from: alebal on August 21, 2016, 09:04:18 PM
Does not work...

These are the log. There you see something strange ???

My test crontab was reduced to sending a mail ... but the email never arrives ...
CWP is on droplet digitalocean, digitalocean can create problems to the crontab?

I do not see any problems in the log.



You can ask me to solve any problem with your server for some money in pm  ;)






Services Monitoring & RBL Monitoring
http://centos-webpanel.com/services-monitor


Join our Development Team and get paid !
http://centos-webpanel.com/develope-modules-for-cwp

Installation Instructions
http://centos-webpanel.com/installation-instructions

Get Fast Support Here
http://centos-webpanel.com/support-services

alebal

Nothing ... still not working ...

I made these 2 files. The first writes the timestamp in a file.
$nome_file_index = $_SERVER['DOCUMENT_ROOT']."/cron_test.txt";
chmod($nome_file_index, 0666);
$file = fopen($nome_file_index, "w") ;
fwrite($file, time());
fclose($file);


It runs via cronjob every 30 minutes.
0 * * * * /usr/local/bin/php /home/pornupda/public_html/cron_test.php
30 * * * * /usr/local/bin/php /home/pornupda/public_html/cron_test.php


The second reads the file with the date.
$filename = "cron_test.txt";
$handle = fopen($filename, "r");
$crontest = fread($handle, filesize($filename));

echo 'Last cron '.date ("D d M Y H:i", $crontest);


It does not work ... That damned date never changes.