arobbert

Registered
Mar 1, 2017
4
0
1
holland
cPanel Access Level
Website Owner
I'm attempting to get this simple Cron command to run from the Cron jobs panel.
** * * * * find /home/CPANELUSERNAME/public_html -mtime -1 \! -type d -ls

The purpose of the command is to alert me when a file changes. CPANELUSERNAME has been changed to my user name and I have set an email address in "send an email when a job runs".

To test this I alter a simple text file in the public_html folder. I don't receive a message indicating the change. I contacted my hosting service Godaddy. They tested Cron functionality on the server. Initially it didn't work. After some adjustments they were able to verify that it is working on the server. However I can't get this to work from inside the control panel.

Any help would be greatly appreciated.
 

SB-Nick

Well-Known Member
Aug 26, 2008
175
9
68
cPanel Access Level
Root Administrator
Hello,

Looks like you have an extra "*" there.
Additionally, make sure there is a MAILTO= line with your email address at the top of the cronjob.

If it's still not working I would try using a shell script instead.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,884
2,243
463
Hello,

It's possible the account does not have permission to utilize the "find" command. You can access the account via SSH if your hosting provider allows it to try running that command manually. If you don't have SSH access, ask your hosting provider to run the command in the jailed environment as the account username to verify it works as expected.

Thank you.
 

arobbert

Registered
Mar 1, 2017
4
0
1
holland
cPanel Access Level
Website Owner
Hello,

Looks like you have an extra "*" there.
Additionally, make sure there is a MAILTO= line with your email address at the top of the cronjob.

If it's still not working I would try using a shell script instead.
Thanks for your reply. The extra ** was a typo in my post. It reads
* * * * * find /home/CPANELUSERNAME/public_html -mtime -1 \! -type d -ls
In the Job.

I have limited knowledge and am not familiar with shell scripts. Is this something I can do in cpanel?

Hello,

It's possible the account does not have permission to utilize the "find" command. You can access the account via SSH if your hosting provider allows it to try running that command manually. If you don't have SSH access, ask your hosting provider to run the command in the jailed environment as the account username to verify it works as expected.

Thank you.
I don't have SSH Access. It looks like it will take a day or so to activate it. Godaddy won't touch code for me.
 
Last edited by a moderator:

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,884
2,243
463
I suspect that Cron is not working for me on godaddy. Can anyone recommend a simple command I can use to test it from within cPanel?
You can't directly check if the crond service is running from within cPanel. You'd need to reach out to your hosting provider to have them look for any issues.

Another option is to try setting up a different cron job that uses something other than the "find" command to rule that command out as the culprit.

Thank you.