Keep tabs on all your cron jobs with this handy self-hosted app

1 week ago 1

Cron is a vital utility within many Linux distributions that allows jobs to be created and scheduled for running tasks at fixed times and intervals. These cron jobs can be created by the system, software, or the user. They are best used for frequent tasks, such as copying files for backups, performing maintenance, and cleaning up. When specified, Linux will run cron jobs as scheduled and perform the required command or script, and while they're particularly useful for servers, you can run them on just about any device.

When creating, running, and managing cron jobs on more than one device, it can prove challenging to keep tabs on when they all run, what they do, and if they're encountering issues that prevent them from executing at the specified times. Whether you're launching programs, sending notifications, or creating some truly wacky cron jobs, I was looking for a way to monitor and manage a few systems and ended up checking out Crontab Guru Dashboard.

Okay, but what is a cron job?

Translating all the jargon

As explained, cron jobs are scheduled tasks that run on Unix-based operating systems, including Linux and macOS. They're designed to run automatically at specified intervals, be it once per day, every hour, or at a specific time and/or day. They are especially handy for running tasks that involve executing a command within the terminal or running a PHP, Python, or some other shell script. For example, if I had a backup.py script that I wanted to run every Friday at 23:59, I would use:

59 23 * * 5 /usr/bin/python3 /path/to/backup.py

The timing works in reverse, so 59 minutes are up first, followed by 23 hours, telling cron to run this job at 23:59. The two asterisks denote any day of the month and any month, followed by a 5 for Friday (1-7 for each day of the week). Cron will run this job at 23:59 every Friday, regardless of the month or week. Since I'm going to be using Python to execute a backup script, we need to call Python, which on Linux would be /usr/bin/python3. Finally, we call our script, /path/to/backup.py.

It's not the most user-friendly way of scheduling tasks, but cron jobs are incredibly versatile and reliable. It's also pretty easy once you get used to the syntax. That's also where Crontab Huru Dashboard comes into play since it can really simplify the entire process from creating these cron jobs to executing and monitoring them.

Checking a network host in ntopng

Related

I monitor my home network by self-hosting ntopng - here’s how

From analyzing your traffic to snooping on malicious devices connected to your network, ntopng can do it all!

What is Crontab Guru Dashboard?

The ultimate way to visualize all your jobs

Crontab Guru Dashboard

This is one handy self-hosted app that can be run on any device or server running cron jobs. With Crontab Guru Dashboard installed and running, you can use it to create and manage cron jobs, run them instantly with a single click, test and tweak them on the fly with a built-in console view, check and terminate running job instances, monitor cron jobs, and you can connect to each installation via SSH so everything stays secure.

Developed by the same teams that work on Cronitor, Crontab Guru Dashboard is a feature-rich and pretty to look at, making it a good option for everyone, including those who may not be most comfortable when it comes to creating and running cron jobs. The best part is that you can install it using Docker, making the installation process that much more streamlined. Just make sure to turn off the telemetry stuff, since no one should see what you're doing, even if it's simply to check how many people install this thing.

Run curl https://crontab.guru/install | TELEMETRY=off sh if installing Crontab Guru Dashboard outside of a Docker environment, to disable the telemetry nonsense.

In a cracking turn of events, one can configure Crontab Guru Dashboard to run automatically at startup through systemd. Even if you decide to run the app through Docker, you can mount the host system's cron jobs with a few easy commands to mount local storage. Everything you'd need is conveniently documented on the official website. Even whitelisting IP addresses, adding users for systemd, and building a Docker image from scratch are all detailed with example commands.

My home lab wouldnt be the same without these 7 Docker containers - featured.jpeg

Related

My home lab wouldn’t be the same without these 7 Docker containers

Nothing in my home would run as smoothly as it does if I hadn't deployed these Docker containers

It's great for the home lab

Keeping tabs on everything

Crontab Guru Dashboard

When running a few cron tabs on various systems, using an instance of Crontab Guru Dashboard on each machine is a handy way of loading up the web interface and checking how things are performing. There are ways to manage cron jobs on the network level, but if you wish to keep things local with everything sandboxed per system, Crontab Guru Dashboard is a great choice for those fleshing out a home lab with various Unix-based operating systems.

And don't worry if it's asking you to upgrade or provide an API key as there's a free tier of the monitoring platform, which is great for home lab and other small projects.

Read Entire Article