📜 ⬆️ ⬇️

Automated backup of Windows workstations using rsync and vshadow - Part 2, setting up a 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 that 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 installing it if you used a custom-built cast from susestudio.com. Typically, you can use a Yast Partitioner to create a RAID Mirror to ease the suffering.

2. If there is a desire to immediately ruin the installed system, we sew it a new kernel. To do this, perform:
zypper ar download.opensuse.org/repositories/Kernel:/stable/standard Kernel:stable
zypper in --from Kernel:stable kernel-default

and restart the system.
')
3. Install truecrypt. Unfortunately, it is not included in the SuSE repository, therefore we execute:
wget 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-x86

Since it lacks an additional library, we decide with the command
zypper in libfuse.so.2

4. Create a protected partition.
: 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 the future, so as not to bother with the commands:

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_xattr


5. Edit the rsyncd daemon configuration files, /etc/rsyncd.conf, add the user and password to /etc/rsyncd.secrets.
This is what rsyncd.conf looks like

gid = 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 < ?


6. We allow the rsync daemon to listen to the required port on it - you can do it in the Yast - Firewall, or manually.

7. Start rsyncd: rcrsyncd start, turn on the service: chckonfig rsyncd on

Run the script, which was considered in the first part, check. He can swear that he cannot create a primary folder by computer name, we decide with an ugly command chmod 777 / backup, this is not critical, as the script will close access to the folder after the first backup. Next time I will talk about a script that will do snapshots by day of the week, as well as connect our Linux machine to the domain and arrange the rights to the shared folders.

Source: https://habr.com/ru/post/132906/


All Articles