I am trying to run a backup script on my ec2 amazon server (ubuntu 14.04), to automatically create a snapshot of amazon ebs volumes. Therefore I am using the aws-missing-tools script: https://github.com/colinbjohnson/aws-missing-tools/tree/master/ec2-automate-backup
This my backup script, that triggers ec2-automate-backup-awscli.sh:
SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin/aws
HOME=/
JAVA_HOME=/usr/lib/jvm/default-java/jre/
MAILTO=xxx.xxxxxx@me.com
AWS_ACCESS_KEY=xxxxxxxxxxxxxxxxxxxx
AWS_SECRET_KEY=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
/opt/aws/ec2-automate-backup-awscli.sh -r us-east-1 -s tag -t 'Backup,Values=true' -k 31 -p
But i only get this error when scheduling this script with crontab:
26 23 * * * /opt/aws/backup.sh >> /var/log/aws.log 2>&1
Log file: "In order to use ec2-automate-backup-awscli.sh, the executable "aws" must be installed."
Directly executing "sh backup.sh" works fine. (snapshots are created.)
Any ideas?
awsexecutable located? Runwhich awsto find out, then add it to the script's PATH variable. – Craig Watson Sep 11 '14 at 23:35