I recently came across the at command on the command line, but I am wondering whether I can write a bash script that somehow enables me to tell the at command to run at 8 pm every day, or every monday, every week etc. basically at regular intervals. How is this possible?
Asked
Active
Viewed 1,859 times
3
-
4Check about `crontab` for this than `at` – Inian Dec 30 '16 at 14:32
-
Is there a possibility to do it with at though? – George Welder Dec 30 '16 at 14:35
-
Possible duplicate of [execute crontab twice daily at 00h and 13:30](http://stackoverflow.com/questions/13993556/execute-crontab-twice-daily-at-00h-and-1330) – Avihoo Mamka Dec 30 '16 at 14:36
-
1Inian is correct. at is a utility to schedule jobs 'later', for one-off things. cron is a utility to schedule repeating jobs. – Benjamin Podszun Dec 30 '16 at 14:36
-
3@GeorgeWelder you could even do it using `at` by rescheduling your own job again at the end of your job. Although `cron` is the goto option for such a scenario – riteshtch Dec 30 '16 at 14:36
-
@ritesht93 ok fair enough! thank you! – George Welder Dec 30 '16 at 15:53
1 Answers
5
at
is the wrong tool for this job.
You're looking for cron
.
8 pm every day would be :
0 20 * * * /bin/execute/this/script.sh
8 pm every monday would be :
0 20 * * 1 /bin/execute/this/script.sh

Eric Duminil
- 52,989
- 9
- 71
- 124