wiki

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

cron.wht (1839B)


      1 Cron
      2 ________________________________________________________________________________
      3 
      4 This will be particularly about 'dcron' with Void Linux (i.e runit).
      5 
      6 [000] Index
      7 ________________________________________________________________________________
      8 
      9 * Jobs ................................................................... [001]
     10 * Examples ............................................................... [002]
     11 * Commandline ............................................................ [003]
     12 
     13 [001] Jobs
     14 ________________________________________________________________________________
     15 
     16 Syntax for declaring a job is:
     17 
     18  %M %H %d %m %a command
     19 
     20 Where '%?' is 'date +format' specifiers ('%M' is minute, etc).
     21 
     22 Cron follows certain specifications,
     23 - '*'             - is a wildcard which makes specifier be ignored.
     24 - '[0-9]+'        - instead of * will make cron run at specified time.
     25 - '[0-9]+,[0-9]+' - will execute job at multiple specified times.
     26 - '[0-9]+-[0-9]+' - will limit execution between certain time.
     27 - '*/[0-9]+'      - will run every N time period.
     28 - '@hourly', '@daily'/'@midnight', '@weekly', '@monthly' and '@reboot' are
     29     shorthands, with hourly being '0 * * * *'.
     30 
     31 Command can be anything that shell can execute.
     32 
     33 You can access '$HOME', '$USER'/'$LOGNAME', '$SHELL' and '$PATH' environment
     34     variables which makes it possible to '. $HOME/.bashrc; $HOME/script.sh'
     35 
     36 [002] Examples
     37 ________________________________________________________________________________
     38 
     39 > TODO: examples
     40 
     41 Verify environment:
     42 
     43  * * * * printenv > ~/cron_env_test.txt
     44 
     45 [003] Commandline
     46 ________________________________________________________________________________
     47 
     48 - list jobs         - crontab -l
     49 - edit job file     - crontab -e
     50 - remove all jobs   - crontab -r
     51 - replace with file - crontab [filename]
     52 - insert from stdin - crontab -