@bws @db_geek
I’ll take for granted that your system already runs crond or any derivative (cronie for example).
crontab creation / admin
There are user crontabs and system crontabs. User crontabs are setup with crontab -e (or crontab -u <login> -e).
System crontabs are in the file /etc/crontab and the directory /etc/cron.d, same syntax but with one more field used to set the user account that will run the line.
If you want everything in one file, use /etc/crontab, if you want a discrete file for each crontab, use /etc/cron.d.
On recent Linux distrib you’ll also find /etc/cron.{daily,hourly,monthly,weekly} directories so that you can dispatch scripts (not crontab) that you want to run daily, hourly, … It looks like an attempt to mimic BSD periodic and if you ask me, I think it’s a very bad idea to have named those directories cron.something when you must not store crontabs inside.
Scripts in those directories are run by corresponding crontabs in /etc/cron.d, for example:
$ cat /etc/cron.d/0hourly
# Run the hourly jobs
SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root
01 * * * * root run-parts /etc/cron.hourly
If you use system crontabs, stick with the file /etc/crontab and the directory /etc/cron.d, store your scripts elsewhere (/opt/foo, /usr/local/bar,…). You don’t need the ill-advised over-engineered /etc/cron.{daily,hourly,monthly,weekly} introduced by Linux distribs.
System crontabs are best for managed servers (a team manages hundreds servers with a config management tool, like Rudder). If you manage, alone and manually, a handful of servers then choice is yours but crontab -e does the trick pretty well.
Logging
If you want to log some output from the command ran by cron on your behalf, you can either pipe output to logger or add >/some/file 2>&1:
*/5 * * * * /path/to/my/script 2>&1 | logger
@daily curl … |awk … | logger -t "baz"
0 10 20 * * /other/script >/tmp/script.output 2>&1
If you want (basic) logs about the cron service, grep you system logs or ask journalctl.
You’ll find here some decent Linux-centric documentation:
https://docs.rockylinux.org/10/fr/guides/automation/cronie/