cronjob Curl does not work on aws

Asked

Viewed 122 times

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

  • I used this command and returned this: 21512 cron this list in running processes

  • Okay, so also see if the cron appears in the logs: grep CRON /var/log/syslog

  • Apparently not. The following error was shown: grep: /var/log/syslog: No such file or directory. Can you tell me how to fix this?

  • Which linux distribution are you using? See if any of the files exist: /var/log/cron, /var/log/messages

  • It’s the file maker. These files exist, but I’m not allowed to access them

  • Unsolved

  • Tried to sudo grep -ic cron /var/log/cron ?

  • 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?

  • 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?

Show 5 more comments
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.