amazon s3 - Bash cron job doesn't execute like it does on command line -
i've written bash script executes python script write file directory, sends file amazon s3. when execute script command line executes perfectly, when run cron, file writes directory, never gets sent s3. must doing wrong cron.
here bash script:
#!/bin/bash #python script exports file home directory python some_script.py #export file created python s3 s3cmd put /home/bitnami/myfile.csv s3://location/to/put/file/myfile.csv
like said before, manually executing works fine using ./bash_script.sh
. when set cron job, file writes directory, never gets sent s3.
my cron job is:
18 * * * * /home/bitnami/bash_script.sh
am using cron incorrectly? please help.
cron looks ok, path .py file not found.
you have add path or home like:
location=/home/bitnami/ python $location/some_script.py
also s3cmd needs located correctly:
/bin/s3cmd
alternative might need load user environment first before executing script find username/password/ssh key s3cmd
Comments
Post a Comment