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 ?...
Lately I've been working on a lot of automation and monitoring projects, a big part of these projects are taking existing scripts and modifying them to be useful for automation and monitoring tools. One thing I have noticed is sometimes scripts use exit codes and sometimes they don't. It seems like exit codes are easy for poeple to forget, but they are an incredibly important part of any script. Especially if that script is used for the command line....
When I was first got started with administrating Linux and Unix servers I was working in an environment where there were tons of adhoc scripts that other admins wrote. From time to time I would find myself troubleshooting why one of those scripts suddenly stopped working. Sometimes the scripts would be well written and easy to understand, other times they were clunky and confusing.
While troubleshooting the poorly written scripts was always a hassle at the time, it taught me an important lesson....
Today is very much a “back to the basics” kind of day. In this article I am going to cover one of the most basic commands in Linux; the cd command. While today's article might be basic; it is always good even for experienced sysadmins, to look back at some of the basics and see if there are ways to improve your command line skills and Linux knowledge.
The Linux/Unix directory structure Before getting into how to change to another directory, let's take a minute to cover how Linux's directory structure is laid out....
Shell scripting is a fundamental skill that every systems administrator should know. The ability to script mundane & repeatable tasks allows a sysadmin to perform these tasks quickly. These scripts can be used for anything from installing software, configuring software or quickly resolving a known issue.
A fundamental core of any programming language is the if statement. In this article I am going to show several examples of using if statements and explain how they work....