It might be very simple question, but how could I run a python script on my fedora dist every 2 days?
Thanks
Antonis
First, create your Python script. Then, open the system terminal your working with. To access crontab, input 'crontab -e' (one will be created if it doesn't already exist). Then enter 'i' to initiate the edit mode, and proceed to input your schedule command.
Double-click on the Task Scheduler, and then choose the option to 'Create Basic Task…' Type a name for your task (you can also type a description if needed), and then press Next. For instance, let's name the task as: Run Hello World. Choose to start the task 'Daily' since we wish to run the Python script daily at 6am.
It is a question on cron. First is add a SHEBANG line on top of your python script.
#!/usr/bin/env python
Make your script executable with chmod +x
And do a crontab -e and add 0 0 */2 * * /path/to/your/pythonscript.py
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With