TOOL » LINUX » APP

Cron

Run script at startup

bash
crontab OPTION
OptionDescription
-lView (list) crontabs.
-eEdit crontabs.
-rRemove crontabs.

Format

txt
mm  hh  DD  MM  W /path/program [--option]...  ( W = weekday: 0-6 [Sun=0] )
SymbolDescription
*Wildcard, specifies every possible time interval
,List multiple values separated by a comma.
-Specify a range between two numbers, separated by a hyphen
/Specify a periodicity/frequency using a slash
KeywordDescription
@rebootAt startup.
@yearlyOnce a year.
@annuallySame as @yearly.
@monthlyOnce a month.
@weeklyOnce a week.
@dailyOnce a day.
@midnightSame as @daily.
@hourlyOnce an hour.

Example

txt
@reboot ${HOME}/test.sh

To check if it is running:

bash
ps -ef | grep test