I've written a bash script that executes a python script to write a file in a directory, then that file S3 to Amazon When I execute the script from the command line it is executed completely, but when I run it with the cron, the file is written to the directory but never sent to the S3. I have to mess some with Cron
Here is the Bash script:
#! / Bin / bash #python script which exports file to home directory some_script python Py #export file put s3cmd created for s3 by phonetic /home/bitnami/myfile.csv s3: // location / to / put / File / myfile.csv
As I said earlier, the execution works fine by manually using ./bash_script.sh
. When I set up a cron job, the file is written to the directory, but never sent to the S3
My cron job is:
18 * * * * / home / bit nami / bash_script.sh
Am I wrong? I am using cron from? help please.
The cron looks fine, however your path will not be found on the .py file.
You must add path or house such as:
location = / home / bitname / python $ location / some_script.py
In addition, s3cmd must be located correctly:
/ bin / s3cmd
Alternatively, before executing the script, your user environment You may also need to load S3cmd
No comments:
Post a Comment