cron

Easy Container Cleanup in Cron + Docker Environments

Let's explore two flags that make it easier to run Dockerized Cron jobs, as well as how we would traditionally create and clean up a Docker container.

Preventing duplicate cron job executions

I feel like sometimes cron jobs create more problems than they solve. It's not the fault of cron, but rather the jobs being executed. This is especially true when the jobs result in duplicate running instances like the following example. $ ps -elf | grep forever 4 S vagrant 4095 4094 0 80 0 - 1111 wait 21:59 ? 00:00:00 /bin/sh -c /var/tmp/forever.sh 0 S vagrant 4096 4095 0 80 0 - 2779 wait 21:59 ?

Cheat Sheet: Crontab by Example

Today's article may be pretty basic for regular readers but hopefully some may find it useful. This article will cover creating a crontab entry and show some examples of common crontabs. The Cron daemon is a service that runs on all main distributions of Unix and Linux and specifically designed to execute commands at a given time. These jobs commonly refereed to as cronjobs are one of the essential tools in a Systems Administrators tool box.

How to check if a cron job ran

Cron is a time based scheduled task daemon that runs on most common Unix/Linux distributions. Because cronjobs are time based sometimes it is necessary to validate that the job ran at the scheduled time. Sometimes people will configure a cron to send the output of the script to a user via system mail or redirect the output to a file; however not all crons are setup the same and many times they may be configured to send output to /dev/null hindering any ability to validate the job ran.

The safest way to deploy a crontab

Many would look at this topic and laugh at the simplicity of the subject, but in an environment where seconds of downtime are a matter of millions of dollars. This is anything but a simple subject. In many cases some very important tasks run through cron, for a quick example log file cleanup. If log clean up doesn't occur eventually a filesystem can get out of hand and fill up causing an application to not be able to write logs.