Title: Theory / Unimportant / CS / Softw / Cron
Tags: computer_to_instruction variable comment

Name: cron
Definition: daemon to execute scheduled commands

Fla: -f
Effect: Stay in foreground mode, don't daemonize.
Prefix: cron

Fla: -l
Effect: Enable  LSB  compliant  names  for  /etc/cron.d files.  This setting, however, does not affect the parsing of files under /etc/cron.hourly, /etc/cron.daily, /etc/cron.weekly or /etc/cron.monthly.
Prefix: cron

Fla: -n
Effect: Include the FQDN in the subject when sending mails.  By default, cron will abbreviate the hostname.
Prefix: cron

Effect: Use log level i
Language: sh
Context: cron
Abbreviation: -L i

Variable: /var/spool/cron/crontabs
Meaning: cron spool area
Context: cron
Language: sh

Variable: /etc/cron.d
Meaning: debian specific directory, similar to /etc/crontab
Context: cron
Language: sh
Abbreviation: Used by package to put cron job

Question: How does cron work
Answer: wake up every minute
Context: cron
Answer2: Look at /etc/crontab to check whether there are change since last update
Answer3: Execute all tasks that are due now
Answer4: email output of jobs to admin or MAILTO
Construction: /etc/cron.d

Variable: /etc/cron.hourly/daily/weekly/monthly
Meaning: Repository for tasks to execute every hour/day/week/minute
Context: cron
Assuming: Debian only

Question: Constraints on cron tasks
Answer: they must be owned by root
Context: cron

Variable: /etc/cron.allow
Meaning: List of user allowing to planify cron job
Context: cron
Language: Constraints on cron tasks

Variable: /etc/cron.deny
Meaning: List of user who can't planify cron job
Context: cron
Assuming: allow file does not exists

Name: crontab
Definition: tables for driving cron
Context: cron
Definition2: the program used to install, deinstall or list the tables used to drive the cron(8) daemon
Conjdef: Both

Effect: Set the crontab as user foo
Language: sh
Context: cron
Abbreviation: -u foo

Fla: -l
Effect: causes the current crontab to be displayed on standard output
Prefix: cron

Fla: -r
Effect: causes the current crontab to be removed.
Prefix: cron

Fla: -e
Effect: edit the current crontab using an editor
Prefix: cron

Fla: -i
Effect: removal require confirmation
Prefix: cron

Variable: /var/spool/cron/crontabs
Meaning: Directory of crontab files for each users
Context: cron
Language: sh

Language: sh
Instruction: # foo (nothing else on the line)
Other fields (not shown on cards):
Context: crontab file

Instruction: MAILTO=foo
Effect: email any report to foo
Language: sh
Context: crontab file

Instruction: *
Effect: All potential values
Language: sh
Context: crontab file time

Instruction: foo_1, ..., foo_n
Effect: Evaluate when the time is any of the foo_i
Context: crontab file time

Instruction: foo-bar
Effect: Evaluate when the time is between foo and bar included
Context: crontab file time

Instruction: foo-bar/plop
Effect: Evaluate when the time is between foo and bar included, and equiv foo mod plop
Context: crontab file time

Instruction: @reboot
Effect: Run once, at startup.
Context: crontab file time

Instruction: @yearly (or annually)/monthly/weekly/daily (or midnight)/hourly
Effect: Run once a year/month/week/day/hour as soon as possible
Context: crontab file time

Instruction: time command % stdinput
Effect: At time time run command and give it stdinput, without variable replacement
Context: crontab file

Instruction: SHELL=foo
Effect: The shell to use to execute commands
Context: crontab file

Instruction: PATH=foo
Effect: The path to use to find programs to execute
Context: crontab file

Question: How are time represented in crontab ?
Answer: minute hour day_of_month month year
Context: crontab file time
Answer2: @special_name