1
|
1
|
#!/bin/bash
|
2
|
2
|
# No way I try to deal with a crippled sh just for POSIX foo.
|
3
|
3
|
|
4
|
|
-# Copyright (C) 2009-2016 Joerg Jaspert <joerg@debian.org>
|
|
4
|
+# Copyright (C) 2009-2016, 2018 Joerg Jaspert <joerg@debian.org>
|
5
|
5
|
#
|
6
|
6
|
# This program is free software; you can redistribute it and/or
|
7
|
7
|
# modify it under the terms of the GNU General Public License as
|
... |
... |
@@ -155,11 +155,16 @@ esac |
155
|
155
|
#
|
156
|
156
|
# ATTENTION: Spaces in arguments or timestamp names need to be escaped by \
|
157
|
157
|
#
|
158
|
|
- # NOTE 1: There are two special values for the first column (FUNC).
|
|
158
|
+ # NOTE 1: There are special values for the first column (FUNC).
|
159
|
159
|
# STATE - do not call stage function, call the state
|
160
|
160
|
# function to update the public statefile "where is dinstall"
|
161
|
161
|
# NOSTAGE - do not call stage function, call the command directly.
|
162
|
|
- #
|
|
162
|
+ # RMSTAGE - clean out the stages directory, and as such
|
|
163
|
+ # the recording what already ran in an earlier cronscript.
|
|
164
|
+ # Note: Only really makes sense at beginning of a tasks file,
|
|
165
|
+ # the stages directory gets cleared at successful exit anyways.
|
|
166
|
+ # RMSTAGE simply ensures that ALL of the crons tasks ALWAYS run.
|
|
167
|
+
|
163
|
168
|
# Note 2: If you want to hand an empty value to the stage function,
|
164
|
169
|
# use the word "none" in the list below.
|
165
|
170
|
while read FUNC ARGS TIME ERR BACKGROUND; do
|
... |
... |
@@ -188,6 +193,11 @@ esac |
188
|
193
|
NOSTAGE)
|
189
|
194
|
${ARGS}
|
190
|
195
|
;;
|
|
196
|
+ RMSTAGE)
|
|
197
|
+ # Make sure we remove our stage files, so all the
|
|
198
|
+ # actions will be done again.
|
|
199
|
+ rm -f ${stagedir}/*
|
|
200
|
+ ;;
|
191
|
201
|
*)
|
192
|
202
|
GO=(
|
193
|
203
|
FUNC=${FUNC}
|