Places where cron jobs can hide
- In
/etc/crontab
- In
/etc/cron.d/*
- In
/etc/cron.hourly/*
- In
/etc/cron.daily/*
- In
/etc/cron.weekly/*
- In
/etc/cron.monthly/*
- In the personal crontab of any user. This is a magic file you can view with
crontab -l
and edit withcrontab -e
. You'll need tosu
to the respective user to view or edit her crontab.
Related cards:
whenever: Installing cron jobs only for a given Rails environment or Capistrano stage
We use the whenever gem to automatically update the crontab of the servers we deploy to. By default, whenever will update all servers with a matching role ([we use the :cron
role ](https://makandracards.com/m...
Can I Email: Check what styling email clients support
The french Tilt Studio built a caniuse clone for email clients.
Note that while checking styling support helps using (or not using) certain features, it cannot substitute for [checking the actual rendering in real clients](...
Adjust cron jobs to allow full backtraces for rake tasks
As we get an exception notification, when a cron job fails, we wish to have the full backtrace in this mail. A rake task doesn't output the full backtrace by default, so you need the --backtrace
option.
Trigger
You will find fail mails wit...
Decide whether cronjobs should run on one or all servers
Understanding your type of cronjob
Some cronjobs must only run on a single server. E.g. when you run nightly batch operations on the database, it should probably run on a single server. Running it on multip...
Simple memory information widget for the Xfce panel (or anywhere else where you can run a shell command)
I was unsatisfied with the existing memory status applets for the Xfce panel, so I wrote a little shell script that shows me just the information I need. Now I use it via a "Generic Monitor" panel applet.
Put this at some place like `~/bin/memory...
Build cronjobs or list next dates
"CronMaker is a utility which helps you to build cron expressions." Check it out at http://www.cronmaker.com/.
To simply check syntax of a cron schedule, paste it into your personal crontab file using crontab -e
. If...
How to show an ordered crontab
Crontabs are often unordered, especially when generated for an application where you usually group tasks by their domain/scope.
An example crontab might look like this:
# Begin Whenever generated tasks for: project100
MAILTO="log@example.com...
Exclusive cronjobs with flock and whenever
I had a very frequent cronjob that in rare cases could be relatively slow. To avoid multiple instances of this cronjob running in parallel, I decided to use flock
to ensure that only one instance could run at a time.
flock
works by acquiring ...
Cronjobs: "Craken" is dead, long live "Whenever"
Our old solution for cronjobs, the "craken" plugin, is no longer maintained and does not work on Rails 3.2+.
We will instead use the whenever gem.
"Whenever" works just like "craken", by putting your rake ta...
Gitlab: How to cancel redundant pipelines
In the Gitlab settings the flag Auto-cancel redundant pipelines is enabled by default. This auto-cancels jobs that have the interruptible
setting set to...