Keywords: Mautic - AWS - How to - Other
I have a python file programmed that makes an automatic backup of the 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.
Here the problem ...
When I want to enter 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
"where is python"
Results: python: /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/
I await your help and I thank you in advance.