Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

aws-cli 1.2.10 cron script fails

I have a crontab that fires a PHP script that runs the AWS CLI command "aws ec2 create-snapshot".

When I run the script via the command line the php script completes successfully with the aws command returning a JSON string to PHP. But when I setup a crontab to run the php script the aws command doesn't return anything.

The crontab is running as the same user as when I run the PHP script on the command line myself, so I am a bit stumped?

like image 275
Theo Kouzelis Avatar asked Jul 20 '26 04:07

Theo Kouzelis


1 Answers

I had the same problem with running a ruby script (ruby script.rb). I replace ruby by its full path (/sources/ruby-2.0.0-p195/ruby) and it worked. in you case, replace "aws" by its full path. to find it: find / -name "aws"

like image 140
Walid Da. Avatar answered Jul 22 '26 19:07

Walid Da.