I have a bash script which is calling another python script.
This is not running in cron because of python global variable. Please find below the script. Script is meant to zip logs and move to Amazon s3. When we run the script from terminal it will work. But when ran from cron it will zip contents then s3cmd which is a python script it fails. Can anyone help me with setting python global variable at cron level.
#!/bin/bash
cd /applications/java/tomcat-instance/foundation/logs/
sudo find /applications/java/tomcat-instance/foundation/logs/ -mtime +1 | xargs tar -czvPf tomcat_logs_`date +%Y%m%d`_`date +%H`.tar.gz
/usr/bin/python s3cmd put /applications/java/tomcat-instance/foundation/logs/tomcat_logs_`date +%Y%m%d`_`date +%H`.tar.gz s3://merck-ghh-logs/preview/deliver$
sudo find /applications/java/tomcat-instance/foundation/logs/ -mtime +7 -exec rm {} \;