Running Cron job on Amazon Instance with Bitnami





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}







0















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?










share|improve this question









New contributor




Franco is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





















  • Welcome to Ask Ubuntu! ;-) Could you please review my edits and also review the editing help to improve the readability of your questions in the future... ;-)

    – Fabby
    Apr 6 at 21:56











  • If you want to run a cron job as a specific user, then rather than using root's crontab (sudo crontab ...) and jumping through hoops with su and shells, I'd suggest using the system-wide crontab file /etc/crontab (or a custom file in /etc/cron.d) where you can specify the username directly as an additional field after the time spec.

    – steeldriver
    Apr 6 at 22:22













  • Hello, Thank you very much for your help. When you install the cronjob in "/etc/crontab" everything works correctly. I really appreciate your help.

    – Franco
    yesterday


















0















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?










share|improve this question









New contributor




Franco is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





















  • Welcome to Ask Ubuntu! ;-) Could you please review my edits and also review the editing help to improve the readability of your questions in the future... ;-)

    – Fabby
    Apr 6 at 21:56











  • If you want to run a cron job as a specific user, then rather than using root's crontab (sudo crontab ...) and jumping through hoops with su and shells, I'd suggest using the system-wide crontab file /etc/crontab (or a custom file in /etc/cron.d) where you can specify the username directly as an additional field after the time spec.

    – steeldriver
    Apr 6 at 22:22













  • Hello, Thank you very much for your help. When you install the cronjob in "/etc/crontab" everything works correctly. I really appreciate your help.

    – Franco
    yesterday














0












0








0








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?










share|improve this question









New contributor




Franco is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.












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?







cron amazon-ec2 bitnami






share|improve this question









New contributor




Franco is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











share|improve this question









New contributor




Franco is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









share|improve this question




share|improve this question








edited Apr 6 at 21:56









Fabby

27.1k1360161




27.1k1360161






New contributor




Franco is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









asked Apr 6 at 19:11









FrancoFranco

1




1




New contributor




Franco is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





New contributor





Franco is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






Franco is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.













  • Welcome to Ask Ubuntu! ;-) Could you please review my edits and also review the editing help to improve the readability of your questions in the future... ;-)

    – Fabby
    Apr 6 at 21:56











  • If you want to run a cron job as a specific user, then rather than using root's crontab (sudo crontab ...) and jumping through hoops with su and shells, I'd suggest using the system-wide crontab file /etc/crontab (or a custom file in /etc/cron.d) where you can specify the username directly as an additional field after the time spec.

    – steeldriver
    Apr 6 at 22:22













  • Hello, Thank you very much for your help. When you install the cronjob in "/etc/crontab" everything works correctly. I really appreciate your help.

    – Franco
    yesterday



















  • Welcome to Ask Ubuntu! ;-) Could you please review my edits and also review the editing help to improve the readability of your questions in the future... ;-)

    – Fabby
    Apr 6 at 21:56











  • If you want to run a cron job as a specific user, then rather than using root's crontab (sudo crontab ...) and jumping through hoops with su and shells, I'd suggest using the system-wide crontab file /etc/crontab (or a custom file in /etc/cron.d) where you can specify the username directly as an additional field after the time spec.

    – steeldriver
    Apr 6 at 22:22













  • Hello, Thank you very much for your help. When you install the cronjob in "/etc/crontab" everything works correctly. I really appreciate your help.

    – Franco
    yesterday

















Welcome to Ask Ubuntu! ;-) Could you please review my edits and also review the editing help to improve the readability of your questions in the future... ;-)

– Fabby
Apr 6 at 21:56





Welcome to Ask Ubuntu! ;-) Could you please review my edits and also review the editing help to improve the readability of your questions in the future... ;-)

– Fabby
Apr 6 at 21:56













If you want to run a cron job as a specific user, then rather than using root's crontab (sudo crontab ...) and jumping through hoops with su and shells, I'd suggest using the system-wide crontab file /etc/crontab (or a custom file in /etc/cron.d) where you can specify the username directly as an additional field after the time spec.

– steeldriver
Apr 6 at 22:22







If you want to run a cron job as a specific user, then rather than using root's crontab (sudo crontab ...) and jumping through hoops with su and shells, I'd suggest using the system-wide crontab file /etc/crontab (or a custom file in /etc/cron.d) where you can specify the username directly as an additional field after the time spec.

– steeldriver
Apr 6 at 22:22















Hello, Thank you very much for your help. When you install the cronjob in "/etc/crontab" everything works correctly. I really appreciate your help.

– Franco
yesterday





Hello, Thank you very much for your help. When you install the cronjob in "/etc/crontab" everything works correctly. I really appreciate your help.

– Franco
yesterday










0






active

oldest

votes












Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "89"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});






Franco is a new contributor. Be nice, and check out our Code of Conduct.










draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1131730%2frunning-cron-job-on-amazon-instance-with-bitnami%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes








Franco is a new contributor. Be nice, and check out our Code of Conduct.










draft saved

draft discarded


















Franco is a new contributor. Be nice, and check out our Code of Conduct.













Franco is a new contributor. Be nice, and check out our Code of Conduct.












Franco is a new contributor. Be nice, and check out our Code of Conduct.
















Thanks for contributing an answer to Ask Ubuntu!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1131730%2frunning-cron-job-on-amazon-instance-with-bitnami%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

GameSpot

日野市

Tu-95轟炸機