Python script in CRON is not running in AWS ubuntu 14.04 instance

I want to schedule a CRON job into AWS Ubuntu instance. I have a simple cron sample like the following:

import pandas as greatPanda
import pprint
import uuid
df = greatPanda.read_csv('/home/soumik/appTornado/di/ABP/df.csv')
pprint.pprint(df)
name = '/home/soumik/appTornado/di/ABP/df_'+str(uuid.uuid4())+'.csv'
df.to_csv(name,index=False)

And I have set the CRON like the following with crontab -e into terminal:

*/1 * * * * python /home/ubuntu/ABP/abp_backend_processing/cronSample.py > /home/ubuntu/ABP/abp_backend_processing/cronlog.txt

The sample code has been run into my local machine with proper CRON functionality but can not find any luck into AWS instance.

1

2 Answers

To set up the cronjob for the user you have logged in for follow this steps

  1. log into the ssh console
  2. Open the crontab file by typing crontab -e
  3. close the file with changes you want to make. In your case the syntax is right.
  4. Once you close the file you can see that 'new crontab is installing' message you are done.

I think your Cron service not started. Try:

service crond start

You can check Cron service status with:

service crond status

Make sure your script file has execute permission.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like