6

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

if file setup via command line so please give a detail step wise.

Does anyone have any advise?

Mark Rotteveel
  • 100,966
  • 191
  • 140
  • 197
Raju Dudhrejiya
  • 1,637
  • 2
  • 15
  • 16
  • Same way you'd do it on any other server. An EC2 instance is just like any other server in terms of cron. – ceejayoz Jun 12 '15 at 15:10

2 Answers2

21

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.

Community
  • 1
  • 1
j3py
  • 1,119
  • 10
  • 22
4

It's just normal cron.

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

John Rotenstein
  • 241,921
  • 22
  • 380
  • 470