Automated backup of Windows workstations using rsync and vshadow - Part 2, setting up the receiving server
As an example, I will use openSUSE 11.4 in text (minimum) mode on the 2.6.37 kernel. (you can also upgrade it to 3.1.1 with several commands, which will be available below)
1. Of course, you must first install a clean operating system and configure RAID. In our case, simple mirroring will be used, that is, RAID 1. This can be configured during the installation of the operating system or collected by its installation if you used a custom-built nugget from susestudio.com. Typically, you can use the Yast Partitioner to ease the suffering to create RAID-Mirror.
2. If there is a desire to immediately destroy the installed system, we will sew a new core for it. To do this, execute: and restart the system. 3. Install truecrypt. Unfortunately, it is not included in the SuSE repository, therefore, we perform: Since it lacks an additional library, we solve it with command 4. Create a secure partition.
zypper ar download.opensuse.org/repositories/Kernel:/stable/standard Kernel:stable
zypper in --from Kernel:stable kernel-defaultwget www.truecrypt.org/download/truecrypt-7.1-linux-console-x86.tar.gz
tar -xvf truecrypt-7.1-linux-console-x86.tar.gz
./truecrypt-7.1-setup-console-x86zypper in libfuse.so.2Создаём: truecrypt -c /dev/sdb (тут ваш райд или партиция) --quick, на всё отвечаем опцией [1]
Подключаем: truecrypt /dev/sdb --filesystem=NONE
Создаём файловую систему: mkfs.ext4 /dev/mapper/truecrypt1
Маунтим: mount /dev/mapper/truecrypt1 /backup
Проверяем, что партиция на месте: df –h Here is the script file that will do this in order not to mess with the commands: 5. Edit the configuration files of the rsyncd daemon, /etc/rsyncd.conf, add the user and password to /etc/rsyncd.secrets. This is what rsyncd.conf 6 looks like . We allow the rsync daemon to listen to the required port on it - it can be done in Yast - Firewall, or manually. 7. Start rsyncd: rcrsyncd start, enable the service: chckonfig rsyncd on
TC_DEV="/dev/sdb" <- девайс
TC_MP="/backup" <- куда?
TC_CONT="/dev/mapper/truecrypt1" <-откуда?
## Truecrypt thing
# Dismount all mounted volumes
truecrypt -d -f
# Mount volumes
truecrypt $TC_DEV --filesystem=none
mount -t ext4 $TC_CONT $TC_MP -o acl,user_xattrgid = users
read only = false
use chroot = true
transfer logging = true
log format = %h %o %f %l %b
log file = /var/log/rsyncd.log
pid file = /var/run/rsyncd.pid
slp refresh = 300
use slp = false
[backupusr]
path = /backup/ <куда писать?
auth users = sbackupusr <кто может писать?
gid = users
read only = no
list = yes
hosts allow = 0.0.0.0/24 <только эти айпи
hosts deny = * <никого лишнего
secrets file = /etc/rsyncd.secrets <где пароль?We start the script which was considered in the first part, we check. He can swear that he cannot create a primary folder by computer name, we decide with the ugly chmod 777 / backup command, this is not critical, since the script itself will close access to the folder after the first backup. Next time I’ll tell you about a script that will do snapshots by day of the week, as well as how to connect our Linux machine to a domain and set up rights to shared folders.