Archive for the 'UNIX' Category

Mac OS X - the perfect sysadmin workstation

If you work as a sysadmin you are most likely using a Windows or *NIX machine as your workstation. I feel sorry for those of you who has to use Windows, *NIX people are slightly better off. However, in my opinion the perfect system administrator workstation is Mac OS X. Why you may ask?

Better Scripts #3 - use logger

When you write scripts, especially scripts that will be executed unattended by cron or a similar facility, in most cases you want some way of getting error messages. Sometimes email is the way to go, sometimes you can just redirect output to a text file. Solaris and most other *NIX operating systems are shipped with […]

Reduce Downtime with rsync

rsync is one of those tools that you find new uses for every day. It is really just a fancy file mover but it has an amazing feature set. Among other things You can control bandwidth usage, resume operations, copy files over ssh and include and exclude files as you like.
In The Practice of System […]

The Practice of System and Network Administration, 2nd Edition

To my delight I saw that Practice of System and Network Administration, The (2nd Edition) is available for pre-order on Amazon. I already own the 1st Edition and it is really a great book. I consider it a must read for any sysadmin or I could even go that far that I would most […]

How to capture your session

If you are doing a very sensitive operation on a server and you want to make sure that you can easily review your actions (and the result) afterwards you have two options:

Rely on the scrollback in your terminal. More often than not you will run out of scrollback
Use script

When you run script it will start […]

Using at to schedule scripts

If you have some basic knowledge of UNIX you probably know about cron. But have you heard about at?
at is very similar to cron. You use it to schedule to run a program/script/command once at a specific time. A very basic example would look like this

$ at now
> date >/var/tmp/date.output
> ^D
job 1 at Mon Jun […]

Better Scripts #2 - Don’t use bash

If you want to cause a controversy on mailing lists go ahead and ask a question about which shell you should use. There are a million different opinions about this even though there is not that many shells available.
However, when you want to write portable scripts please don’t use bash but use ksh (or even […]

Never change system files

On most UNIX-like operating system all the standard binaries are install in /bin, /usr/bin, /sbin and /usr/sbin. There are some additional compatibility directories (at least on Solaris) but most of the essential binaries are to be found in those directories. If you download any kind of open source software (that doesn’t have a binary package […]

Sysadmin Blog #1: My SysAd Blog

Roy Wood has a blog that targets a similar audience as my own. He write articles about UNIX system administration in particular about Solaris, Oracle, Sybase and other interesting technologies. He focus a lot on how to do things and in may be very interesting if you are an aspiring sysadmin. I will definitely keep […]

Better Scripts #1

Oops! You just sent the root password for your central MySQL server to a big mailing list. You scramble to change it as fast as possible. Sometimes you may need to include a password or some other important information in cleartext in a script. A database backup script could be a good example. You whip […]