backup server on Debian squeeze Remastersys

Today I will tell you how to make a backup server on debian 6 is a hot topic for each system administrator (without this no where)!
and so, we panadobâtsâ brand new repositories are doing here is that …
open for editing the file
Add the following
deb squeeze/
apt-get update
and install the software
apt-get install remastersys
After installation, see config file I have a little bit of it
Opportunities out there a little bit, but you can improve.
Now about using.
Backup-creates a full backup of the system (including the folder user settings/home/);
cleanremoves temporary files, which are formed in the process of creating a distribution package. The correct thing. Saves space, but if you do not copy the image somewhere of the distribution, which has turned out-he too is deleted;
Distcreate your image. The same as the backup, but without copying user data from your/home;
CDFScreate a file with the file system without creating ISO image (ideal if you want to create an ISO image of another program);
ISO is used by default, creates an ISO image distro;
[filename.iso]last parameter specifies the name of the ISO image file is placed in the directory/home/remastersys.
Next we need to create a startup script to create the backup, the backup folders that are needed can be added to the config files and so on
First, we create a file that will be our mighty script. Simple but very good.
I have all those backups will throw off the puller and there’s also going to create this script
Next, create a folder where the backups will be stored
This is for SQUID
This is for SAMBA
This is for web folders
This is for database dump
Это для бэкапа всей системы целиком в ISO образ, чтобы в случае чего можно было все снести и накатить заново
Делаем скрипт его исполняемым:
Далее открываем его на редактирование/ и пишем примерно следующее:
# префикс с датой
Date_pref = ‘ date +%F ‘
# В переменной BACKUP_xxx_DIR лежит путь, куда будет сохраняться бэкап к каталогу с файлами, текущая дата будет браться из переменной DATE_PREF
# ищем файлы старше 7 суток и удаляем их, дабы не засорять жесткий диск
find/media/windows/homes/-mtime + 7-print-mindepth 1-delete >/dev/null 2>&1 2>>/var/log/backup.log
find/media/windows/samba/-mtime + 7-print-mindepth 1-delete >/dev/null 2>&1 2>>/var/log/backup.log
find/media/windows/bd/-mtime + 7-print-mindepth 1-delete >/dev/null 2>&1 2>>/var/log/backup.log
find/media/windows/www/-mtime + 7-print-mindepth 1-delete >/dev/null 2>&1 2>>/var/log/backup.log
# Удаляем старые бэкапы системы, чтобы не плодить лишние
find/media/windows/iso/system-iso/install-mtime + 7-print-mindepth 1-delete >/dev/null 2>&1 2>>/var/log/backup.log
# создаем tar ‘ ом
tar cpzf $BACKUP_HOME_DIR\>/dev/null 2>&1 2>>/var/log/backup.log
tar cpzf $BACKUP_SAMBA_DIR\>/dev/null 2>&1 2>>/var/log/backup.log
tar cpzf $BACKUP_WWW_DIR\>/dev/null 2>&1 2>>/var/log/backup.log
# создаем дампы баз данных MySQL. Обязательно указываем пользователя и пароль
# Тут же упаковываем gzip-ом
mysqldump-q-u root-pВаш пароль рута-h localhost имя бд которую хотите забэкапить | gzip-c > $BACKUP_MYSQL_DIR\-xxx.sql.gz
mysqldump-q-u root-pВаш пароль рута
# Делаем INSTALL. ISO бэкап с помощью Remastersys
remastersys backup install-$DATE_NOW.iso
# Копируем образ и MD5 отпечаток для сохранности и проверки образа
# Если не скопировать, то при очистке временных файлов образ удалится
# Очищаем временные файлы
remastersys clean
Configure remastersys, to do so, open the file/etc/remastersys.conf and make the following changes:
# Specify the directory in which you will create the image
WORKDIR = /home/remastersys
# Exclude Folders. razderitel′-space.
EXCLUDES = /backups
# Name of image
# The name of the image file
CUSTOMISO = install-$ 1. iso”