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
Script provides three distinct modes for restoring data, each designed for a different scenario.
100
+
101
+
#### 1. Interactive Restore (`--restore`)
102
+
103
+
This is an interactive wizard for guided restores. It is the best option when you are at the terminal and need to find and recover specific files or directories.
104
+
105
+
- **Best for**: Visually finding and restoring specific files or small directories.
106
+
- **Process**:
107
+
- Lists available snapshots for you to choose from.
108
+
- Asks for a destination path.
109
+
- Performs a "dry run" to show you what will be restored before making any changes.
110
+
- Requires your confirmation before proceeding with the actual restore.
This mode runs the restore in the foreground and waits for it to complete before exiting. It's a reliable, non-interactive way to create a complete, consistent copy of backup data.
142
+
143
+
- **Best for**: Creating a secondary copy of backup (for example, via a cron job) on another server (for a 3-2-1 strategy) or for use in any automation where subsequent steps depend on the restore being finished.
144
+
- **How it works**:
145
+
- This command is **non-interactive** and requires the snapshot ID and destination path as command-line arguments.
146
+
- It runs as a synchronous (blocking) process. When a cron job executes the command, the job itself will not finish until the restore is 100% complete.
147
+
- This guarantees the data copy is finished before any other commands are run or the cron job is marked as complete.
148
+
149
+
**Usage:**
150
+
151
+
```sh
152
+
# On a second server, pull a full copy of the latest backup
# Go to the Restic GitHub releases page to find the URL for the latest version:
231
+
# https://github.com/restic/restic/releases
232
+
233
+
# Download the latest binary for your architecture (replace URL with the one you found)
234
+
curl -LO <URL_of_latest_restic_linux_amd64.bz2>
120
235
```
121
236
122
237
```sh
@@ -126,6 +241,8 @@ chmod +x restic_*
126
241
sudo mv restic_* /usr/local/bin/restic
127
242
```
128
243
244
+
-----
245
+
129
246
#### Package Breakdown
130
247
131
248
| Package | Required For |
@@ -183,6 +300,8 @@ The most reliable way for the script to connect to a remote server is via an SSH
183
300
sudo ssh storagebox pwd
184
301
```
185
302
303
+
-----
304
+
186
305
### 3. Place and Configure Files
187
306
188
307
1. Create your script directory:
@@ -287,6 +406,8 @@ Before the first backup, you need to create the repository password file and ini
287
406
sudo ./restic-backup.sh --init
288
407
```
289
408
409
+
-----
410
+
290
411
### 5. Set up an Automated Schedule (Recommended)
291
412
292
413
The easiest and most reliable way to schedule your backups is to use the script's built-in interactive wizard. It will guide you through creating and enabling either a modern `systemd timer` (recommended) or a traditional `cron job`.
@@ -334,6 +455,6 @@ To run the backup automatically, edit the root crontab.
334
455
335
456
```
336
457
337
-
*For pune job in your `restic-backup.conf`, set `PRUNE_AFTER_FORGET=true`.*
458
+
*For prune job in your `restic-backup.conf`, set `PRUNE_AFTER_FORGET=true`.*
338
459
*For more details on how forget flag work, see the [official Restic documentation on removing snapshots](https://restic.readthedocs.io/en/stable/060_forget.html).*
339
460
*Redirecting output to `/dev/null` is recommended, as the script handles its own logging and notifications.*
0 commit comments