Skip to content

Commit 8e31863

Browse files
author
buildplan
committed
formatting and explanation for restore modes.
1 parent e83e914 commit 8e31863

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

README.md

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -94,13 +94,13 @@ For those familiar with setting up backup scripts, here is a fast track to get y
9494

9595
-----
9696

97-
### Restoring Your Data
97+
### Restoring Data
9898

99-
The script provides three distinct modes for restoring data, each designed for a different scenario.
99+
Script provides three distinct modes for restoring data, each designed for a different scenario.
100100

101101
#### 1. Interactive Restore (`--restore`)
102102

103-
This is a user-friendly 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.
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.
104104

105105
- **Best for**: Visually finding and restoring specific files or small directories.
106106
- **Process**:
@@ -122,9 +122,9 @@ This mode is designed for restoring large amounts of data (e.g., a full server r
122122
- **Best for**: Large, time-consuming restores or recovering data over a slow network connection.
123123
- **How it works**:
124124
- This command is **non-interactive**. You must provide the snapshot ID and destination path as arguments directly on the command line.
125-
- The restore job is launched in the background, immediately freeing up your terminal.
125+
- The restore job is launched in the background, immediately freeing up terminal.
126126
- All output is saved to a log file in `/tmp/`.
127-
- You will receive a success or failure notification (via ntfy, Discord, etc.) upon completion.
127+
- A success or failure notification (via ntfy, Discord, etc.) upon completion.
128128

129129
**Usage:**
130130

@@ -138,20 +138,23 @@ sudo ./restic-backup.sh --background-restore a1b2c3d4 /mnt/disaster-recovery
138138

139139
#### 3. Synchronous Restore (`--sync-restore`)
140140

141-
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 your backup data.
141+
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.
142142
143-
- **Best for**: Creating a secondary copy of your backup on another server (for a 3-2-1 strategy) or for use in any automation where subsequent steps depend on the restore being finished.
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.
144144
- **How it works**:
145145
- This command is **non-interactive** and requires the snapshot ID and destination path as command-line arguments.
146-
- It runs as a foreground process, blocking the terminal or script until the restore is 100% complete.
147-
- This guarantees the data copy is finished before any other commands are run.
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.
148148
149149
**Usage:**
150150
151151
```sh
152152
# On a second server, pull a full copy of the latest backup
153153
sudo ./restic-backup.sh --sync-restore latest /mnt/local-backup-copy
154154
155+
# On your secondary server, run a sync-restore every day at 5:00 AM.
156+
0 5 * * * /path/to/your/script/restic-backup.sh --sync-restore latest /path/to/local/restore/copy >> /var/log/restic-restore.log 2>&1
157+
155158
# Can also be used in a script to ensure a process runs only after a restore
156159
sudo ./restic-backup.sh --sync-restore latest /srv/app/data && systemctl restart my-app
157160
```

0 commit comments

Comments
 (0)