Skip to main content...
Linux + Bash Scripting
20 min

Day 11: cron & scheduled tasks; disk/memory/log inspection

cron: scheduling recurring work

cron runs commands on a fixed schedule defined by five time fields: minute, hour, day-of-month, month, day-of-week. 0 2 * * * means "at 02:00 every day."

crontab -e syntax
# m h  dom mon dow   command
  0  2  *   *   *     /opt/scripts/backup.sh
  */15 * * * *         /opt/scripts/healthcheck.sh   # every 15 minutes

Inspecting a live system

The four commands you'll run constantly
df -h            # disk usage per filesystem
du -sh /var/log  # size of a specific directory
free -h          # memory: used, free, available, swap
tail -f /var/log/syslog   # follow a log file live

The number that actually matters

free -h's "available" column (not "free") is the real answer to "how much memory can a new process actually use" — Linux aggressively uses spare RAM for disk cache, which free -h counts separately but "available" already accounts for as reclaimable.

Key terms

cron
A time-based job scheduler for recurring commands.
crontab
A user's (or system's) table of scheduled cron jobs.

What does the cron schedule `*/15 * * * *` mean?

We use cookies

We use cookies to enhance your browsing experience, serve personalized content, and analyze our traffic. By clicking "Accept All", you consent to our use of cookies. Learn more

    Day 11: cron & scheduled tasks; disk/memory/log inspection | RBTechIconX