Changeset db38f7b
- Timestamp:
- 12/17/2018 01:19:23 AM (6 years ago)
- Branches:
- elogind
- Children:
- 54ed60b
- Parents:
- 32dfda12
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
general.ent
r32dfda12 rdb38f7b 7 7 <!ENTITY copyholder "The BLFS Development Team"> 8 8 <!ENTITY version "&year;-&month;-&day;"> 9 <!ENTITY releasedate "December 1 5th, &year;">9 <!ENTITY releasedate "December 17th, &year;"> 10 10 <!ENTITY pubdate "&year;-&month;-&day;"> <!-- metadata req. by TLDP --> 11 11 <!ENTITY blfs-version "svn"> <!-- svn|[release #] --> -
general/sysutils/fcron.xml
r32dfda12 rdb38f7b 231 231 </indexterm> 232 232 233 <bridgehead renderas="sect4">Periodic Jobs</bridgehead> 234 235 <para> 236 If you would like to setup a periodic hierarchy for the root user, 237 first issue the following commands (as the 238 <systemitem class="username">root</systemitem> user to create the 239 <filename>/usr/bin/run-parts</filename> script: 240 </para> 241 242 <screen role="root"><userinput>cat > /usr/bin/run-parts << "EOF" && 243 #!/bin/sh 244 # run-parts: Runs all the scripts found in a directory. 245 # from Slackware, by Patrick J. Volkerding with ideas borrowed 246 # from the Red Hat and Debian versions of this utility. 247 248 # keep going when something fails 249 set +e 250 251 if [ $# -lt 1 ]; then 252 echo "Usage: run-parts <directory>" 253 exit 1 254 fi 255 256 if [ ! -d $1 ]; then 257 echo "Not a directory: $1" 258 echo "Usage: run-parts <directory>" 259 exit 1 260 fi 261 262 # There are several types of files that we would like to 263 # ignore automatically, as they are likely to be backups 264 # of other scripts: 265 IGNORE_SUFFIXES="~ ^ , .bak .new .rpmsave .rpmorig .rpmnew .swp" 266 267 # Main loop: 268 for SCRIPT in $1/* ; do 269 # If this is not a regular file, skip it: 270 if [ ! -f $SCRIPT ]; then 271 continue 272 fi 273 # Determine if this file should be skipped by suffix: 274 SKIP=false 275 for SUFFIX in $IGNORE_SUFFIXES ; do 276 if [ ! "$(basename $SCRIPT $SUFFIX)" = "$(basename $SCRIPT)" ]; then 277 SKIP=true 278 break 279 fi 280 done 281 if [ "$SKIP" = "true" ]; then 282 continue 283 fi 284 # If we've made it this far, then run the script if it's executable: 285 if [ -x $SCRIPT ]; then 286 $SCRIPT || echo "$SCRIPT failed." 287 fi 288 done 289 290 exit 0 291 EOF 292 chmod -v 755 /usr/bin/run-parts</userinput></screen> 293 294 <para> 295 Next, create the directory layout for the periodic jobs (again as the 296 <systemitem class="username">root</systemitem> user): 297 </para> 298 299 <screen role="root"><userinput>install -vdm754 /etc/cron.{hourly,daily,weekly,monthly}</userinput></screen> 300 301 <para> 302 Finally, add the <command>run-parts</command> to the system fcrontab 303 (while still the <systemitem class="username">root</systemitem> user): 304 </para> 305 306 <screen role="root"><userinput>cat > /var/spool/fcron/systab.orig << "EOF" 307 &bootrun 01 * * * * root run-parts /etc/cron.hourly 308 &bootrun 02 4 * * * root run-parts /etc/cron.daily 309 &bootrun 22 4 * * 0 root run-parts /etc/cron.weekly 310 &bootrun 42 4 1 * * root run-parts /etc/cron.monthly 311 EOF</userinput></screen> 312 233 313 </sect3> 234 314 … … 251 331 252 332 <screen role="root" revision="systemd"><userinput>systemctl enable fcron</userinput></screen> 333 334 <para>Finally, again as the <systemitem class="username">root</systemitem> 335 user, start fcron and generate the 336 <filename>/var/spool/fcron/systab</filename> file:</para> 337 338 <screen role="root"><userinput>/etc/rc.d/init.d/fcron start && 339 fcrontab -z -u systab</userinput></screen> 253 340 254 341 </sect3> -
introduction/welcome/changelog.xml
r32dfda12 rdb38f7b 44 44 45 45 <listitem> 46 <para>December 17th, 2018</para> 47 <itemizedlist> 48 <listitem> 49 <para>[dj] - Add periodic cron configuration for fcron.</para> 50 </listitem> 51 </itemizedlist> 52 </listitem> 53 54 <listitem> 46 55 <para>December 16th, 2018</para> 47 56 <itemizedlist>
Note:
See TracChangeset
for help on using the changeset viewer.