Crontab
From EventScripts Community Encyclopedia
OverviewSyntax: Note: Command parameters are described inside the
< and > characters. Optional parameters are contained within [ and ] characters.DescriptionCreates cronjobs for the HL2 engine similar to the Un*x crontab program.
Parameters
SHORTCUTS Entry Description Equivalent To -------------------------------------------------- #yearly Run once a year 0 0 1 1 * #annually (same as #yearly) 0 0 1 1 * #monthly Run once a month 0 0 1 * * #weekly Run once a week 0 0 * * 0 #daily Run once a day 0 0 * * * #midnight (same as #daily) 0 0 * * * #hourly Run once an hour 0 * * * * ================================================== Example: crontab #daily "es_msg The server is restarting in 1 minute!; es_xdelayed 60 _restart"
ExamplesSample commands you can add to your scripts or enter into your server's console. // Notes: // Use asterisks to denote all available times. // Use commas to separate different values within the same time denomination. // Use dashes to include all options between two numbers in the same time denomination. // Use diagonals to divide the time by a given number and execute on each match. // Read the examples and notes in es_crontab.txt carefully to understand each option. // This "command" executes every 20 minutes, 8am-5pm, Mon-Fri crontab 0,20,40 8-17 * * 1-5 "command" // This "command" executes every 2 minutes crontab */2 * * * * "command" // This is the same as typing crontab 0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46,48,50,52,54,56,58 * * * * "command" // This "command" executes every 3 hours, 6pm-6am, Mon-Fri crontab 0 18-6/3 * * 1-5 "command" // This cronjob will be added only if the job does not exist already crontab 0 4 * * * "command" cg_restart // This does the same thing as the command above. crontab 0 4 * * * "command" cg_restart 0 // This cronjob will overwrite any existing job by the same name crontab 0 3 * * 0,6 "command" cg_weekend 1 // This "command" is executed every minute crontab * * * * * "command" Notes
See also |
