Posts for August, 2011

No custom kernel via ssh

August 21, 2011 Posted in FreeBSD General

Tried to build a custom kernel on a canceled server, I couldn’t connect to it once the build started, I also couldn’t connect to it after the build finished and server rebooted. I don’t think I will build custom kernels ever again on remote servers.

DoS Attacks

August 21, 2011 Posted in FreeBSD General

If your server was down due to insufficient swap space, usually needed by large amount of MySQL connections, it’s a sign of DoS attacks. My servers started to get attacks earlier this year, and they were getting increasingly frequent. Here are some simple practices I have employed, they have been proved to be effective for my server in the last few months.
Read More

Backup Script

August 21, 2011 Posted in Command & Utility

My simple backup script
It runs daily with cron job.

#!/bin/sh

# directory to backup
BACKUP_DIR=’/home/’

# directory to store backup files
DEST_DIR=’/backup/’

# number of days to store backup files
MAX_DAYS=30

# base backup file name
BASE_FILENAME=’home’

# remove files that are 30 or more days old.
find $DEST_DIR -mtime +$MAX_DAYS -maxdepth 1 -name ‘*.tgz’ -exec /bin/rm -f ‘{}’ +

# generate backup file name with date stamp, no hour/minute info for easier remote backup.
destfilename=$BASE_FILENAME`date “+%Y%m%d”`.tgz

cd $BACKUP_DIR
tar czf $DEST_DIR$destfilename . &

Read More



Archives