0

How can I run a python script once at exactly 12:00PM on Wednesday (Jan 21)?

I've added #!/usr/bin/env python to the top of my script and made the script executable with chmod +x

I know I want to do something like crontab -e 0 0 * * * /path/to/my/pythonscript.py but I'm not exactly sure how to get it to be a specific time...

3

1 Answer 1

1

To run on 21 Jan at 12pm you will need the following line in your crontab file: 0 12 21 1 * /path/to/my/pythonscript

Edit the crontab file with crontab -e

The first number is minute, the second number is hour, the third one day of month, the fourth month, the fifth is day of week (in this case a * for any day of week), then the path.

The wikipedia entry on Cron is really helpful if you want to change the times.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.