You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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`)
Copy file name to clipboardExpand all lines: docs/guides/backup/rsnapshot_backup.md
+65-66Lines changed: 65 additions & 66 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
---
2
-
title: Backup Solution - Rsnapshot
2
+
title: Backup Solution - _rsnapshot_
3
3
author: Steven Spencer
4
4
contributors: Ezequiel Bruni
5
5
tested with: 8.5, 8.6, 9.0
@@ -8,7 +8,7 @@ tags:
8
8
- rsnapshot
9
9
---
10
10
11
-
# Backup Solution - Rsnapshot
11
+
# Backup Solution - _rsnapshot_
12
12
13
13
## Prerequisites
14
14
@@ -23,15 +23,63 @@ tags:
23
23
24
24
_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.
25
25
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.
27
27
28
28
This documentation covers the installation of _rsnapshot_ on Rocky Linux only.
29
29
30
-
=== "9.0 Install"
30
+
=== "EPEL Install"
31
31
32
-
## Rocky Linux 9.0 - Installing Rsnapshot
32
+
## Installing _rsnapshot_
33
33
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.
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`.
35
83
36
84
### Installing Development Tools and Downloading the Source
37
85
@@ -107,55 +155,6 @@ This documentation covers the installation of _rsnapshot_ on Rocky Linux only.
107
155
108
156
This covers copying the configuration file over. The section below on "Configuring rsnapshot" will cover the changes needed in this configuration file.
109
157
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.
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
164
163
2. Type `dmesg | grep sd` which should show you the drive you want to use. In this case, it'll be called _sda1_.
165
164
Example: `EXT4-fs (sda1): mounting ext2 file system using the ext4 subsystem`.
166
165
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`
168
167
4. Type `sudo umount /dev/sda1` to unmount your external hard drive.
169
168
5. Next, create a new mount point for the backup: `sudo mkdir /mnt/backup`
170
169
6. Now mount the drive to your backup folder location: `sudo mount /dev/sda1 /mnt/backup`
171
170
7. Now type `mount | grep sda1` again, and you should see something like this: `/dev/sda1 on /mnt/backup type ext2 (rw,relatime)`
172
171
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`
173
172
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.
175
174
176
175
We recommend automation. Automation is the sysadmin way.
177
176
@@ -199,7 +198,7 @@ We need to change this to our mount point that we created above plus the additio
199
198
200
199
`snapshot_root /mnt/backup/storage/`
201
200
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:
203
202
204
203
`no_create_root 1`
205
204
@@ -211,7 +210,7 @@ So that it now reads:
211
210
212
211
`cmd_cp /usr/bin/cp`
213
212
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:
215
214
216
215
`#cmd_ssh /usr/bin/ssh`
217
216
@@ -246,13 +245,13 @@ For now write your changes (`SHIFT :wq!` for `vi`) and exit the configuration fi
246
245
247
246
### Checking The Configuration
248
247
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:
250
249
251
250
`rsnapshot configtest` will show `Syntax OK` if there are no errors in the configuration.
252
251
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.
254
253
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:
256
255
257
256
`rsnapshot -c /etc/rsnapshot.conf configtest`
258
257
@@ -331,11 +330,11 @@ In this case, you will want to install _rsnapshot_ on the machine that is doing
331
330
332
331
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.
333
332
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:
335
334
336
335
[SSH Public Private Key Pairs](../security/ssh_public_private_keys.md)
337
336
338
-
## Rsnapshot Configuration
337
+
## _rsnapshot_ Configuration
339
338
340
339
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.
341
340
@@ -397,7 +396,7 @@ Automating backups for the multiple machine/server version is slightly different
@@ -430,4 +429,4 @@ Restoring a backup, either a few files or a complete restore, involves copying t
430
429
431
430
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.
432
431
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