Running Cron job on Amazon Instance with Bitnami

I have a python file programmed that makes an automatic backup of my Amazon instance.

In this instance I have Mautic Bitnami installed.

I have tried to run the file from the next line, directly in the terminal and it works correctly.

python3 /home/bitnami/aws/snapshot_script.py --volume-ids = vol-07701xxxxxxxxxx --expiry-days = 7

(Create a backup that expires in 7 days.)

This is how the snapshot_script.py file begins:

#!/usr/bin/env python3

The problem starts when I want to execute the line of code in a cron job, it does not work.

I have tried many things without getting results, for example:

  • Change python to /usr/bin/python3
  • Change python to //usr/bin/env python3
  • Use your bitnami -s when starting the cron
  • sudo crontab -l to see if it is executed (yes it does)
  • sudo adduser bitnami daemon recommended on the web
  • Copy the structure of the other crons:

    /5 * * * * su daemon -s /bin/sh -c "/opt/bitnami/php/bin/php -q /opt/bitnami/apps/mautic/htdocs/app/console mautic:segments:update" #mautic-segments-cron

the results of locate python are:

/usr/bin/python3.5
/usr/bin/python3.5m
/usr/lib/python2.7
/usr/lib/python3.5
/etc/python3.5
/usr/local/lib/python3.5
/usr/include/python3.5m
/usr/share/

How should I proceed?

3 Reset to default

Know someone who can answer? Share a link to this question via email, Twitter, or Facebook.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like