Skip to content

Commit a5387ed

Browse files
authored
Changes to the rsnapshot procedure required since the release of the package in the EPEL for version 9.x and other changes: (#993)
* Renamed the "9.0 Install" tab to "Source Install" * Renamed the "8.6 Install" tab to "EPEL Install" * moved the order so that the "EPEL Install" tab is first * fixed inconsistent package naming format issues (`rsnapshot` to _rsnapshot_) * reworded sections that had dealt directly with the 9.0 version * changed a few other bits of wording to simplify and clarify * added packages `openssh-server` and `rsync` to the EPEL Install section as these are still required, even though most should already be installed * added command back ticks to some of the commands included in the mount procedure that had been simply words. (example dmesg became `dmesg`)
1 parent f83b352 commit a5387ed

File tree

1 file changed

+65
-66
lines changed

1 file changed

+65
-66
lines changed

docs/guides/backup/rsnapshot_backup.md

Lines changed: 65 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: Backup Solution - Rsnapshot
2+
title: Backup Solution - _rsnapshot_
33
author: Steven Spencer
44
contributors: Ezequiel Bruni
55
tested with: 8.5, 8.6, 9.0
@@ -8,7 +8,7 @@ tags:
88
- rsnapshot
99
---
1010

11-
# Backup Solution - Rsnapshot
11+
# Backup Solution - _rsnapshot_
1212

1313
## Prerequisites
1414

@@ -23,15 +23,63 @@ tags:
2323

2424
_rsnapshot_ is a very powerful backup utility that can be installed on any Linux-based machine. It can either back up a machine locally, or you can back up multiple machines, say servers for instance, from a single machine.
2525

26-
_rsnapshot_ uses `rsync` and is written entirely in perl with no library dependencies, so there are no weird requirements to install it. In the case of Rocky Linux, you should generally be able to install _rnapshot_ by using the EPEL repository. However, the EPEL for 9.0 does not yet have _rsnapshot_ available. For this reason, on Rocky Linux 9.0, we've included the instructions for installing from source.
26+
_rsnapshot_ uses `rsync` and is written entirely in perl with no library dependencies, so there are no weird requirements for installation. In the case of Rocky Linux, you should generally be able to install _rnapshot_ by using the EPEL repository. After the initial release of Rocky Linux 9.0, there was a period of time when the EPEL did not contain the _rsnapshot_ package. That has since been rectified, but we have included a method of installing from source just in case this should happen again.
2727

2828
This documentation covers the installation of _rsnapshot_ on Rocky Linux only.
2929

30-
=== "9.0 Install"
30+
=== "EPEL Install"
3131

32-
## Rocky Linux 9.0 - Installing Rsnapshot
32+
## Installing _rsnapshot_
3333

34-
Since the release of Rocky Linux 9.0, the EPEL repository has not yet built _rsnapshot_ in RPM form. There are currently bugzilla entries referencing others who would like to have this happen, but as of now, that has not happened. The workaround is to install _rsnapshot_ from source. Because this is going to require build utilities, you'll need to install the 'Development Tools' group so that you have everything you need.
34+
All commands shown here are from the command-line on your server or workstation unless otherwise noted.
35+
36+
### Installing The EPEL repository
37+
38+
We need the EPEL software repository from Fedora to install _rsnapshot_. To install the repository, just use this command:
39+
40+
```
41+
sudo dnf install epel-release
42+
```
43+
44+
The repository should now be active.
45+
46+
### Install the _rsnapshot_ Package
47+
48+
Next, install _rsnapshot_ and some other needed tools, which are probably already installed:
49+
50+
```
51+
sudo dnf install rsnapshot openssh-server rsync
52+
```
53+
54+
If there are any missing dependencies, those will show up and you simply need to answer the prompt to continue. For example:
55+
56+
```
57+
dnf install rsnapshot
58+
Last metadata expiration check: 0:00:16 ago on Mon Feb 22 00:12:45 2021.
59+
Dependencies resolved.
60+
========================================================================================================================================
61+
Package Architecture Version Repository Size
62+
========================================================================================================================================
63+
Installing:
64+
rsnapshot noarch 1.4.3-1.el8 epel 121 k
65+
Installing dependencies:
66+
perl-Lchown x86_64 1.01-14.el8 epel 18 k
67+
rsync x86_64 3.1.3-9.el8 baseos 404 k
68+
69+
Transaction Summary
70+
========================================================================================================================================
71+
Install 3 Packages
72+
73+
Total download size: 543 k
74+
Installed size: 1.2 M
75+
Is this ok [y/N]: y
76+
```
77+
78+
=== "Source Install"
79+
80+
## Installing _rsnapshot_ From Source
81+
82+
Installing _rsnapshot_ from source is not difficult. It does come with a downside, however, in that if there is a new version released, it would require a fresh install from source to update the version, whereas the EPEL installation method would keep you up-to-date with a simple `dnf upgrade`.
3583

3684
### Installing Development Tools and Downloading the Source
3785

@@ -107,55 +155,6 @@ This documentation covers the installation of _rsnapshot_ on Rocky Linux only.
107155

108156
This covers copying the configuration file over. The section below on "Configuring rsnapshot" will cover the changes needed in this configuration file.
109157

110-
=== "8.6 Install"
111-
112-
## Rocky Linux 8.6 - Installing Rsnapshot
113-
114-
All commands shown here are from the command-line on your server or workstation unless otherwise noted.
115-
116-
### Installing The EPEL repository
117-
118-
We need the EPEL software repository from Fedora to install _rsnapshot_. To install the repository, just use this command:
119-
120-
```
121-
sudo dnf install epel-release
122-
```
123-
124-
The repository should now be active.
125-
126-
### Install the Rsnapshot Package
127-
128-
Next, install _rsnapshot_ itself:
129-
130-
```
131-
sudo dnf install rsnapshot
132-
```
133-
134-
If there are any missing dependencies, those will show up and you simply need to answer the prompt to continue. For example:
135-
136-
```
137-
dnf install rsnapshot
138-
Last metadata expiration check: 0:00:16 ago on Mon Feb 22 00:12:45 2021.
139-
Dependencies resolved.
140-
========================================================================================================================================
141-
Package Architecture Version Repository Size
142-
========================================================================================================================================
143-
Installing:
144-
rsnapshot noarch 1.4.3-1.el8 epel 121 k
145-
Installing dependencies:
146-
perl-Lchown x86_64 1.01-14.el8 epel 18 k
147-
rsync x86_64 3.1.3-9.el8 baseos 404 k
148-
149-
Transaction Summary
150-
========================================================================================================================================
151-
Install 3 Packages
152-
153-
Total download size: 543 k
154-
Installed size: 1.2 M
155-
Is this ok [y/N]: y
156-
```
157-
158-
159158
## Mounting A Drive or Filesystem For Backup
160159

161160
In this step, we show how to mount a hard drive, such as an external USB hard drive, that will be used to back up your system. This particular step is only necessary if you are backing up a single machine or server, as seen in our first example below.
@@ -164,14 +163,14 @@ In this step, we show how to mount a hard drive, such as an external USB hard dr
164163
2. Type `dmesg | grep sd` which should show you the drive you want to use. In this case, it'll be called _sda1_.
165164
Example: `EXT4-fs (sda1): mounting ext2 file system using the ext4 subsystem`.
166165
3. Unfortunately (or fortunately depending on your opinion) most modern Linux desktop operating systems automount the drive if they can. This means that, depending on various factors, _rsnapshot_ might lose track of the hard drive. We want the drive to "mount" or make its files available in the same place every time.
167-
To do that, take the drive information revealed in the dmesg command above and type `mount | grep sda1`, which should show something like this: `/dev/sda1 on /media/username/8ea89e5e-9291-45c1-961d-99c346a2628a`
166+
To do that, take the drive information revealed in the `dmesg` command above and type `mount | grep sda1`, which should show something like this: `/dev/sda1 on /media/username/8ea89e5e-9291-45c1-961d-99c346a2628a`
168167
4. Type `sudo umount /dev/sda1` to unmount your external hard drive.
169168
5. Next, create a new mount point for the backup: `sudo mkdir /mnt/backup`
170169
6. Now mount the drive to your backup folder location: `sudo mount /dev/sda1 /mnt/backup`
171170
7. Now type `mount | grep sda1` again, and you should see something like this: `/dev/sda1 on /mnt/backup type ext2 (rw,relatime)`
172171
8. Next create a directory that must exist for the backup to continue on the mounted drive. We are using a folder called "storage" for this example: `sudo mkdir /mnt/backup/storage`
173172

174-
Note that for a single machine, you will have to either repeat the umount and mount steps each time the drive is plugged in again, or each time the system reboots, or automate these commands with a script.
173+
Note that for a single machine, you will have to either repeat the `umount` and `mount` steps each time the drive is plugged in again, or each time the system reboots, or automate these commands with a script.
175174

176175
We recommend automation. Automation is the sysadmin way.
177176

@@ -199,7 +198,7 @@ We need to change this to our mount point that we created above plus the additio
199198

200199
`snapshot_root /mnt/backup/storage/`
201200

202-
We also want to tell the backup NOT to run if the drive is not mounted. To do this, remove the "#" sign (also called a remark, pound sign, number sign, hash symbol, etc.) next to no_create_root so that it looks like this:
201+
We also want to tell the backup NOT to run if the drive is not mounted. To do this, remove the "#" sign (also called a remark, pound sign, number sign, hash symbol, etc.) next to `no_create_root` so that it looks like this:
203202

204203
`no_create_root 1`
205204

@@ -211,7 +210,7 @@ So that it now reads:
211210

212211
`cmd_cp /usr/bin/cp`
213212

214-
While we do not need cmd_ssh for this particular configuration, we will need it for our other option below and it doesn't hurt to have it enabled. So find the line that says:
213+
While we do not need `cmd_ssh` for this particular configuration, we will need it for our other option below and it doesn't hurt to have it enabled. So find the line that says:
215214

216215
`#cmd_ssh /usr/bin/ssh`
217216

@@ -246,13 +245,13 @@ For now write your changes (`SHIFT :wq!` for `vi`) and exit the configuration fi
246245

247246
### Checking The Configuration
248247

249-
We want to make sure that we didn't add spaces or any other glaring errors to our configuration file while we were editing it. To do this, we run _rsnapshot_ against our configuration with the configtest option:
248+
We want to make sure that we didn't add spaces or any other glaring errors to our configuration file while we were editing it. To do this, we run _rsnapshot_ against our configuration with the `configtest` option:
250249

251250
`rsnapshot configtest` will show `Syntax OK` if there are no errors in the configuration.
252251

253-
You should get into the habit of running configtest against a particular configuration. The reason for that will be more evident when we get into the **Multiple Machine or Multiple Server Backups** section.
252+
You should get into the habit of running `configtest` against a particular configuration. The reason for that will be more evident when we get into the **Multiple Machine or Multiple Server Backups** section.
254253

255-
To run configtest against a particular configuration file, run it with the -c option to specify the configuration:
254+
To run `configtest` against a particular configuration file, run it with the -c option to specify the configuration:
256255

257256
`rsnapshot -c /etc/rsnapshot.conf configtest`
258257

@@ -331,11 +330,11 @@ In this case, you will want to install _rsnapshot_ on the machine that is doing
331330

332331
For the server that will be running the backups, we need to generate an SSH key-pair for use during the backups. For our example, we will be creating RSA keys.
333332

334-
If you already have a set of keys generated, you can skip this step. You can find out by doing an `ls -al .ssh` and looking for an id_rsa and id_rsa.pub key pair. If none exists, use the following link to set up keys for your machine and the server(s) that you want to access:
333+
If you already have a set of keys generated, you can skip this step. You can find out by doing an `ls -al .ssh` and looking for an `id_rsa` and `id_rsa.pub` key pair. If none exists, use the following link to set up keys for your machine and the server(s) that you want to access:
335334

336335
[SSH Public Private Key Pairs](../security/ssh_public_private_keys.md)
337336

338-
## Rsnapshot Configuration
337+
## _rsnapshot_ Configuration
339338

340339
The configuration file needs to be just like the one we created for the **Basic Machine or Single Server Backup** above, except that we want to change some of the options.
341340

@@ -397,7 +396,7 @@ Automating backups for the multiple machine/server version is slightly different
397396
With the content:
398397

399398
```
400-
#!/bin/bash
399+
#!/bin/bash/
401400
# script to run rsnapshot backups in succession
402401
/usr/bin/rsnapshot -c /etc/rsnapshot_web.conf beta
403402
/usr/bin/rsnapshot -c /etc/rsnapshot_mail.conf beta
@@ -430,4 +429,4 @@ Restoring a backup, either a few files or a complete restore, involves copying t
430429

431430
Getting the setup right with _rsnapshot_ is a little daunting at first, but can save you loads of time backing up your machines or servers.
432431

433-
_rsnapshot_ is very powerful, very fast, and very economical on disk space usage. You can find more information on Rsnapshot, by visiting [rsnapshot.org](https://rsnapshot.org/download.html)
432+
_rsnapshot_ is very powerful, very fast, and very economical on disk space usage. You can find more information on _rsnapshot_, by visiting [rsnapshot.org](https://rsnapshot.org/download.html)

0 commit comments

Comments
 (0)