CRONTABS(4)

πŸ“¦ version 1.11^20190603git9e74f2d, in centos-stream 10, centos-stream 9, fedora 43, fedora 44

πŸ’– CRONTABS(4) β€” the crontabs girlies' manual πŸ’–

okay bestie, welcome to crontabs β€” from the Crontabs users' Manual, no cap. this one's about configuration and scripts for running periodical jobs, and it's shorter than you think, so let's lock in ✨


✨ SYNOPSIS ✨

run-parts [--list|--test]<directory>

that's it. that's the whole vibe. one little script, two little flags, one directory. πŸŽ€


🌸 DESCRIPTION 🌸

so crontabs is a historical name β€” like, vintage, lowkey iconic β€” for the run-parts script and the system crontab. and the run-parts command? it runs all the executables in the directory you point it at. every single one. it's giving "everyone's invited to the party" πŸ’…

but you can gatekeep the guest list 🚫✨ the execution of files can be allowed or denied by creating file jobs jobs.allow or jobs.deny, which worked similar as other allow/deny config files. and listen β€” the file must be created in the specified directory. no hiding it somewhere else, bestie, it has to live right there in the directory. 🫢

  • --list β€” print names of all files (not limited to executables), but don't run them. this option can't be used with test option. so it's the "who's coming" list without actually throwing the party πŸŽ€
  • --test β€” print names of files, which would be run. the dress rehearsal, the preview, the soft launch πŸ”₯

πŸ¦‹ the randomization of jobs thing πŸ¦‹

ngl this part is the main character. randomization of jobs can be configured in the /etc/sysconfig/run-parts file. to enable randomization of jobs, set the RANDOMIZE parameter to 1 and set the RANDOM parameter to an integer which determines a random seed. ✨

and if that's not enough chaos for you β€” additionally, you may configure the RANDOMTIME parameter (again, by specifying an integer) to provide an additional level of randomization. double randomization. double the slay. 🧚

⚠️ important bestie: jobs are not randomized when the RANDOM and RANDOMTIME parameters are set to 0. and values in these two parameters must be set to 1 or larger to provide a good enough randomization. so 0 = off, 1+ = actually random. don't come for me, that's just what the page says πŸ’€

randomization of cron jobs can be useful for shared networks, where multiple cron jobs executed at once can cause spikes in traffic, especially during daily jobs. with randomized jobs, the workload is evenly distributed throughout the day. it's giving load balancing but make it cute 🌈


πŸ“ EXAMPLE OF CONFIGURATION FILE πŸ“

here's the whole mood, copy it exactly bestie:

RANDOMIZE=1
RANDOM=4
RANDOMTIME=8

πŸ‘‘ historically… πŸ‘‘

so historically the crontab file contained configuration which called run-parts on files in cron.{daily,weekly,monthly} directories. but these jobs are now run indirectly through anacron to prevent conflicts between cron and anacron. periodt. 🫢

that means the anacron package has to be installed if the jobs in these directories should be running. no anacron, no daily/weekly/monthly jobs, simple as that. refer to anacron(8) how to limit the time of day of the job execution. ⏰


🌈 EXAMPLE 🌈

/etc/cron.daily/jobs.deny could contain for example 0logwatch which forbid execution of this script.

so you drop that one line in, and 0logwatch is officially uninvited from the party πŸ™ˆ


πŸ’œ SEE ALSO πŸ’œ


and that's the whole page, bestie!! πŸ’– this absolute classic was written by Marcela MaΕ‘lÑňovΓ‘ and dated 2012-08-29, and it's the CRONTABS(4) page from the Crontabs users' Manual. go forth and schedule responsibly πŸŽ€βœ¨πŸ’…

πŸ“¦ where this page comes from