viagra
phentermine

Archive for the ‘Shell scripts’ Category

Avoiding Disaster with a Remote Archive

Friday, February 8th, 2008

Whether or not you have a good backup strategy, with tape rotation and so forth, it’s still a nice insurance policy to identify a half-dozen critical files and have them sent to a separate off-site archive system. Even if it’s just that one key file that contains customer addresses, invoices, or even email from your sweetheart, having an occasional off-site archive can save your life when you least expect it.

(more…)

Rotating Log Files

Monday, February 4th, 2008

Users who don’t have much experience with Unix can be quite surprised by how many commands, utilities, and daemons log events to system log files. Even on a computer with lots of disk space, it’s important to keep an eye on the size of these files and, of course, on their contents too.

(more…)

Managing Backups

Monday, February 4th, 2008

Managing system backups is a task that all system administrators are familiar with, and it’s something that no one thanks you for doing unless something goes horribly wrong. Even on a single-user personal computer running Linux, some sort of backup schedule is essential, and it’s usually only after you’ve been burned once, losing a chunk of data and files, that you realize the value of a regular backup.

(more…)

Backing Up Directories

Monday, February 4th, 2008

Related to the task of backing up entire file systems is the user-centric task of taking a snapshot of a specific directory or directory tree. This simple script allows users to easily create a compressed tar archive of a specified directory.

(more…)

Figuring Out Available Disk Space

Monday, February 4th, 2008

Related to disk quota management is the simpler question of how much disk space is available on the system. The df command reports disk usage on a per-disk basis, but the output can be a bit baffling:

$ df
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/hdb2 25695892 1871048 22519564 8% /
/dev/hdb1 101089 6218 89652 7% /boot
none 127744 0 127744 0% /dev/shm

What would be much more useful is a version of df that summarizes the available capacity values in column four and then presents the summary in a way that is easily understood. It’s a task easily accomplished in a script.

(more…)