Archive

Archive for December, 2007

Backup with rsync

December 29th, 2007

You can easily backup your server with rsync. I prefer rsync over ssh. Here is a brief example:

rsync -avz -e ssh troot@yourdomain.com:/root .

This will backup your root directory via ssh to your local box (make a backup directory and cd to it before you execute).

You can eliminate the login requirements if you automate the ssh login like this:

Do this on your local server:

ssh-keygen -t dsa1

cat ~/.ssh/id_dsa.pub | ssh user@server “cat – >> ~/.ssh/authorized_keys”

Now you can login w/o a password via ssh or sftp.

tech ramblings

more smartd.conf

December 14th, 2007

Carefully review your /var/log/messsages for smartd messages. You can eliminate them all by adding a custom version of the following to the smartd.conf file.

/dev/hda -l error \
-l selftest \
-t \ # Attributes not tracked:
-I 194 \ # temperature
-I 195 \
-I 190 \
-I 231 \ # also temperature
-I 9 # power-on hours

tech ramblings

test for clamd daemon

December 7th, 2007

Here is a simple script to test the clamd daemon and restart it if it is dead. Change the paths and file names to suit your preferences.

#clamdtest

TARGET=clamd.socket
STATUS=`ls /tmp | grep $TARGET 2>/dev/null`
CODE=$?
NOW=`date`
if [ $CODE -gt 0 ]; then
echo $NOW DOWN >> /var/log/clamav/status;/usr/local/sbin/clamd
else
echo $NOW UP >> /var/log/clamav/status
fi

You can set this up and run it with cron like this:

01,21,41 * * * * /usr/local/bin/clamdtest 1> /dev/null

tech ramblings

Drive error messages – Centos

December 4th, 2007

Tired of seeing these drive error messages in your log file?

hda: drive_cmd: error=0×04 { DriveStat …: 1 Time(s)
hda: drive_cmd: status=0×51 { DriveReady SeekComplete Error }

If your running a Red Hat or Centos it probably is caused by a harmless message caused by smartd (smartmontools that monitor hard disk for errors). It can be caused if your drive is smart capable and not in the database on your system. You can eliminate the message by editing /etc/smartd.conf and remove the first line of the file ( # SMARTD*AUTOGENERATED* /etc/smartd.conf) and uncomment the line containing DEVICESCAN. Save, then reboot and you should see no more messages.

tech ramblings

Upgrading to Centos 5.1

December 3rd, 2007

I have upgraded several servers to Centos 5.1. The only major problem I have found is with dovecot imap. You should modify your dovecot.conf file (in /etc) as follows: uncomment login_process_size and set it to login_process_size = 64. Then restart dovecot. I could not access imap from my local network without this modification.

tech ramblings