How To Run A Shell Script Once A Day?
I am trying to run this particular shell script only one time, daily. Here's my code for runLucene.py: #!/usr/bin/env python import os from extras.download_datos_desambiguar impor
Solution 1:
The command crontab -e
will open up an interactive editor within which you can define a cron job.
Within that editor's buffer, you can then enter a line such as the following (and then save it):
0000 * * * /path/to/script.sh
This command will run script.sh
every midnight.
Solution 2:
cron is always doing its thing, I think it's quite a bit better to use that rather than having a python script dedicated to constantly checking if it's time to run the shell script.
With that said, when you create the crontab, it'll go under the users crontab, so just watch the user and/or -u it.
Post a Comment for "How To Run A Shell Script Once A Day?"