Typically on Linux you use crontab for such scduled tasks. But you must specify the time when you "set the timer" - therefore, if you want it to be configured in the file itself, you need to create some kind of mechanism for this.
But in general, you would use, for example:
30 1 * * 5 /path/to/script/script.sh
Executed a script every Friday at 1:30 (AM) Here:
30 minutes
1 - hour
next 2 * are day of month and month (in that order), and 5 is a weekday
julumme Sep 22 '13 at 15:52 2013-09-22 15:52
source share