/special/raw/
Signed-off-by: Steven Armstrong <steven@icarus.ethz.ch>
This commit is contained in:
		
					parent
					
						
							
								1ea0ea0b1b
							
						
					
				
			
			
				commit
				
					
						10d0cf00d6
					
				
			
		
					 3 changed files with 9 additions and 8 deletions
				
			
		| 
						 | 
				
			
			@ -35,9 +35,10 @@ month::
 | 
			
		|||
   See crontab(5). Defaults to *
 | 
			
		||||
day_of_week::
 | 
			
		||||
   See crontab(5). Defaults to *
 | 
			
		||||
special::
 | 
			
		||||
   See EXTENSIONS in crontab(5). e.g. reboot, yearly, monthly
 | 
			
		||||
   If given all other time and date fields are ignored.
 | 
			
		||||
raw::
 | 
			
		||||
   Take whatever the user has given instead of time and date fields.
 | 
			
		||||
   If given, all other time and date fields are ignored.
 | 
			
		||||
   Can for example be used to specify cron EXTENSIONS like reboot, yearly etc.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
EXAMPLES
 | 
			
		||||
| 
						 | 
				
			
			@ -50,7 +51,7 @@ __cron some-id --user root --command "/path/to/script" \
 | 
			
		|||
 | 
			
		||||
# run on reboot
 | 
			
		||||
__cron some-id --user root --command "/path/to/script" \
 | 
			
		||||
   --special reboot
 | 
			
		||||
   --raw @reboot
 | 
			
		||||
 | 
			
		||||
# remove cronjob
 | 
			
		||||
__cron some-id --user root --command "/path/to/script" --state absent
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -25,9 +25,9 @@ command="$(cat "$__object/parameter/command")"
 | 
			
		|||
# set defaults
 | 
			
		||||
test -f "$__object/parameter/state" || echo "present" > "$__object/parameter/state"
 | 
			
		||||
 | 
			
		||||
if [ -f "$__object/parameter/special" ]; then
 | 
			
		||||
   special="$(cat "$__object/parameter/special")"
 | 
			
		||||
   entry="@$special $command"
 | 
			
		||||
if [ -f "$__object/parameter/raw" ]; then
 | 
			
		||||
   raw="$(cat "$__object/parameter/raw")"
 | 
			
		||||
   entry="$raw $command"
 | 
			
		||||
else
 | 
			
		||||
   minute="$(cat "$__object/parameter/minute" 2>/dev/null || echo "*")"
 | 
			
		||||
   hour="$(cat "$__object/parameter/hour" 2>/dev/null || echo "*")"
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -4,4 +4,4 @@ hour
 | 
			
		|||
day_of_month
 | 
			
		||||
month
 | 
			
		||||
day_of_week
 | 
			
		||||
special
 | 
			
		||||
raw
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue