Cant setup curl cronjob

Hi, i am having some trouble to setup some cronjobs for wp all import.
I have tried to far:

But none of these work. Any clues on why they do not work? :expressionless:
Am i typing something wrong here ?

Post the result of concatenating the cron log. Use this command cat /var/log/syslog | grep CRON assuming you used debian os and cat /var/log/cron on CentOs

Hi, here is the results

> Oct 18 15:03:01 localhost CRON[528516]: (root) CMD (if ! find /home/*/public_html/ -maxdepth 2 -type f -newer /usr/local/lsws/cgid -name '.htaccess' -exec false {} +; then systemctl restart lsws; fi)
> Oct 18 15:04:01 localhost CRON[528557]: (root) CMD (/usr/sbin/imunify-notifier -update-cron)
> Oct 18 15:05:01 localhost CRON[528596]: (root) CMD (/usr/sbin/imunify-notifier -update-cron)
> Oct 18 15:05:01 localhost CRON[528597]: (root) CMD (   imunify360-agent malware on-demand check-detached > /dev/null 2>&1  || :)
> Oct 18 15:05:01 localhost CRON[528598]: (usrname) CMD (cURL "https://mydomain.com/wp-load.php?import_key=mykey&import_id=1&action=processing")
> Oct 18 15:06:01 localhost CRON[528671]: (root) CMD (/usr/sbin/imunify-notifier -update-cron)
> Oct 18 15:06:01 localhost CRON[528672]: (root) CMD (if ! find /home/*/public_html/ -maxdepth 2 -type f -newer /usr/local/lsws/cgid -name '.htaccess' -exec false {} +; then systemctl restart lsws; fi)
> Oct 18 15:07:01 localhost CRON[528718]: (root) CMD (/usr/sbin/imunify-notifier -update-cron)
> Oct 18 15:08:01 localhost CRON[528753]: (root) CMD (/usr/sbin/imunify-notifier -update-cron)
> Oct 18 15:09:01 localhost CRON[528792]: (root) CMD (/usr/sbin/imunify-notifier -update-cron)
> Oct 18 15:09:01 localhost CRON[528793]: (root) CMD (/usr/local/CyberCP/bin/cleansessions >/dev/null 2>&1)
> Oct 18 15:09:01 localhost CRON[528794]: (root) CMD (if ! find /home/*/public_html/ -maxdepth 2 -type f -newer /usr/local/lsws/cgid -name '.htaccess' -exec false {} +; then systemctl restart lsws; fi)
> Oct 18 15:10:01 localhost CRON[528874]: (root) CMD (/usr/sbin/imunify-notifier -update-cron)
> Oct 18 15:10:01 localhost CRON[528873]: (root) CMD (   imunify360-agent malware on-demand check-detached > /dev/null 2>&1  || :)
> Oct 18 15:10:01 localhost CRON[528875]: (usrname) CMD (cURL "https://mydomain.com/wp-load.php?import_key=mykey&import_id=1&action=processing")
> Oct 18 15:11:01 localhost CRON[528945]: (root) CMD (/usr/sbin/imunify-notifier -update-cron)
> Oct 18 15:12:01 localhost CRON[528996]: (root) CMD (/usr/sbin/imunify-notifier -update-cron)
> Oct 18 15:12:01 localhost CRON[528997]: (root) CMD (if ! find /home/*/public_html/ -maxdepth 2 -type f -newer /usr/local/lsws/cgid -name '.htaccess' -exec false {} +; then systemctl restart lsws; fi)
> Oct 18 15:13:01 localhost CRON[529038]: (root) CMD (/usr/sbin/imunify-notifier -update-cron)
> Oct 18 15:14:01 localhost CRON[529086]: (root) CMD (/usr/sbin/imunify-notifier -update-cron)
> Oct 18 15:15:01 localhost CRON[529183]: (root) CMD (/usr/sbin/imunify-notifier -update-cron)
> Oct 18 15:15:01 localhost CRON[529182]: (root) CMD (   imunify360-agent malware on-demand check-detached > /dev/null 2>&1  || :)
> Oct 18 15:15:01 localhost CRON[529184]: (root) CMD (if ! find /home/*/public_html/ -maxdepth 2 -type f -newer /usr/local/lsws/cgid -name '.htaccess' -exec false {} +; then systemctl restart lsws; fi)
> Oct 18 15:15:01 localhost CRON[529185]: (usrname) CMD (cURL "https://mydomain.com/wp-load.php?import_key=mykey&import_id=1&action=processing")
> Oct 18 15:16:01 localhost CRON[529281]: (root) CMD (/usr/sbin/imunify-notifier -update-cron)
> Oct 18 15:17:01 localhost CRON[529350]: (root) CMD (/usr/sbin/imunify-notifier -update-cron)
> Oct 18 15:17:01 localhost CRON[529351]: (root) CMD (   cd / && run-parts --report /etc/cron.hourly)
> Oct 18 15:18:01 localhost CRON[529405]: (root) CMD (/usr/sbin/imunify-notifier -update-cron)
> Oct 18 15:18:01 localhost CRON[529406]: (root) CMD (if ! find /home/*/public_html/ -maxdepth 2 -type f -newer /usr/local/lsws/cgid -name '.htaccess' -exec false {} +; then systemctl restart lsws; fi)
> Oct 18 15:19:01 localhost CRON[529447]: (root) CMD (/usr/sbin/imunify-notifier -update-cron)
> Oct 18 15:20:01 localhost CRON[529490]: (root) CMD (   imunify360-agent malware on-demand check-detached > /dev/null 2>&1  || :)
> Oct 18 15:20:01 localhost CRON[529489]: (root) CMD (/usr/sbin/imunify-notifier -update-cron)
> Oct 18 15:20:01 localhost CRON[529491]: (usrname) CMD (cURL "https://mydomain.com/wp-load.php?import_key=mykey&import_id=1&action=processing")
> Oct 18 15:21:01 localhost CRON[529563]: (root) CMD (/usr/sbin/imunify-notifier -update-cron)
> Oct 18 15:21:01 localhost CRON[529562]: (root) CMD (if ! find /home/*/public_html/ -maxdepth 2 -type f -newer /usr/local/lsws/cgid -name '.htaccess' -exec false {} +; then systemctl restart lsws; fi)
> Oct 18 15:22:01 localhost CRON[529621]: (root) CMD (/usr/sbin/imunify-notifier -update-cron)
> Oct 18 15:23:01 localhost CRON[529661]: (root) CMD (/usr/sbin/imunify-notifier -update-cron)
> Oct 18 15:24:01 localhost CRON[529702]: (root) CMD (/usr/sbin/imunify-notifier -update-cron)
> Oct 18 15:24:01 localhost CRON[529703]: (root) CMD (if ! find /home/*/public_html/ -maxdepth 2 -type f -newer /usr/local/lsws/cgid -name '.htaccess' -exec false {} +; then systemctl restart lsws; fi)
> Oct 18 15:25:01 localhost CRON[529770]: (root) CMD (/usr/sbin/imunify-notifier -update-cron)
> Oct 18 15:25:01 localhost CRON[529771]: (root) CMD (   imunify360-agent malware on-demand check-detached > /dev/null 2>&1  || :)
> Oct 18 15:25:01 localhost CRON[529772]: (usrname) CMD (cURL "https://mydomain.com/wp-load.php?import_key=mykey&import_id=1&action=processing")
> Oct 18 15:26:01 localhost CRON[529843]: (root) CMD (/usr/sbin/imunify-notifier -update-cron)
> Oct 18 15:27:01 localhost CRON[529886]: (root) CMD (if ! find /home/*/public_html/ -maxdepth 2 -type f -newer /usr/local/lsws/cgid -name '.htaccess' -exec false {} +; then systemctl restart lsws; fi)
> Oct 18 15:27:01 localhost CRON[529885]: (root) CMD (/usr/sbin/imunify-notifier -update-cron)
> Oct 18 15:28:01 localhost CRON[529944]: (root) CMD (/usr/sbin/imunify-notifier -update-cron)
> Oct 18 15:29:01 localhost CRON[530067]: (root) CMD (/usr/sbin/imunify-notifier -update-cron)
> Oct 18 15:30:01 localhost CRON[530316]: (root) CMD (/usr/sbin/imunify-notifier -update-cron)
> Oct 18 15:30:01 localhost CRON[530317]: (root) CMD (if ! find /home/*/public_html/ -maxdepth 2 -type f -newer /usr/local/lsws/cgid -name '.htaccess' -exec false {} +; then systemctl restart lsws; fi)
> Oct 18 15:30:01 localhost CRON[530318]: (root) CMD (   imunify360-agent malware on-demand check-detached > /dev/null 2>&1  || :)
> Oct 18 15:30:01 localhost CRON[530320]: (root) CMD (/usr/local/CyberCP/bin/python /usr/local/CyberCP/IncBackups/IncScheduler.py '30 Minutes')
> Oct 18 15:30:01 localhost CRON[530322]: (usrname) CMD (cURL "https://mydomain.com/wp-load.php?import_key=mykey&import_id=1&action=processing")

You will need to raise the the cron debug level nano /etc/rsyslog.d/50-default.conf uncomment cron.* /var/log/cron.log" then run /etc/init.d/rsyslog restart or service rsyslog restart to restart rsyslog (via systemctl): rsyslog.service and restart cron service cron restart. Tail the daemon to see live logs tail -f /var/log/cron.log.

EDIT: if /var/log/cron.log does not exist create it using touch /var/log/cron.log

Many thanks jose.
The issue was solved when i did the

service cron restart

Everything works fine now using

/usr/bin/curl curl “https://mydomain.com/wp-load.php?import_key=mykey&import_id=1&action=trigger”

I still cant belive that this restart was the reason this cron took me so many hours :frowning:
Thanks again :slight_smile:

1 Like