How to enable cron schedule in AWS EC2 instance

Step 1 – Connect to your ec2 instance ( follow below article )

https://learnsqlteam.com/2018/11/30/how-to-connect-aws-ec2-instance-through-terminal/

step 2 – go to /etc – ( cd /etc )

step 3 – edit crontab ( nano crontab )

step 4 – define schedule and command

e.g.  in this example I am sysning file b/w ec2 instance and s3 bucket in every min.

crontab

step 5 – start cron service if its not running

for debian/Ubuntu/Linux

sudo service cron status

sudo service cron stop

sudo service cron start

sudo service cron restart
for RHEL\CentOS\Fedora

sudo service crond status

sudo service crond stop

sudo service crond start

sudo service crond restart

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s