How to cron job setup in Amazon ec2

前端 未结 2 951
刺人心
刺人心 2021-01-06 03:47

I have an Amazon EC2 instance running my website. I need to setup a Cron Job to run my file every 12hours.

if file setup via command line so please give a detail ste

相关标签:
2条回答
  • 2021-01-06 03:50

    It's just normal cron.

    See: HowTo: Add Jobs To cron Under Linux or UNIX?

    0 讨论(0)
  • 2021-01-06 04:06

    I recently began using Amazon's linux distro on ec2 instances and after trying all kinds of things for cron all I needed was:
    sudo service crond start
    crontab -e
    This allowed me to set a cron job as "ec2-user" without specifying the user. For example:
    0 12 * * * python3 example.py
    In fact, specifying a user here prevented it from running. I also posted this here.

    0 讨论(0)
提交回复
热议问题