1
Hello, I’m trying to generate a cronjob on Amazon Web Services (aws), I tried several ways but it doesn’t work. Here’s the code:
*/2 * * * * /usr/bin/Curl http://11.11.11.11/caminho/checar
using only
/usr/bin/Curl http://11.11.11.11/caminho/checar
direct works normally, only scheduled task that does not. Would anyone tell me what the problem is? Thank you!
See if the cron is running:
pgrep cron
– user622
I used this command and returned this: 21512 cron this list in running processes
– Eryc Masselli
Okay, so also see if the cron appears in the logs:
grep CRON /var/log/syslog
– user622
Apparently not. The following error was shown: grep: /var/log/syslog: No such file or directory. Can you tell me how to fix this?
– Eryc Masselli
Which linux distribution are you using? See if any of the files exist:
/var/log/cron
,/var/log/messages
– user622
It’s the file maker. These files exist, but I’m not allowed to access them
– Eryc Masselli
Unsolved
– Eryc Masselli
Tried to
sudo grep -ic cron /var/log/cron
?– sergiopereira
The most common errors when using cron are: permissions, syntax wrong in crontab and differences in environment variables (including PATH, so I always use absolute paths as you did). In your case I doubt the permissions. What is the path of this crontab and which user owns the file? Can you run the command as this user?
– sergiopereira
The following message was displayed when typing the above command: 5814. The server accesses itself with a file url, this file has these attributes:
-rwxrwxr-x 1 ec2-user ec2-user 2774 Oct 6 12:33 checkAds.php
Only file permissions would be enough?– Eryc Masselli