crontab python 1

crontab python

from crontab import CronTab
cron = CronTab(user='root')
job ='echo hello_world')

Here is what the above code is Doing:
1. Importing the CronTab class from the crontab module
2. Creating a new CronTab object
3. Creating a new CronJob object
4. Setting the CronJob to run every minute
5. Writing the CronTab object to the crontab file

Similar Posts