-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
fix: exclude volume-backups from web server backup rsync command #4015
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -67,7 +67,7 @@ export const runWebServerBackup = async (backup: BackupSchedule) => { | |
| await execAsync(cleanupCommand); | ||
|
|
||
| await execAsync( | ||
| `rsync -a --ignore-errors --no-specials --no-devices ${BASE_PATH}/ ${tempDir}/filesystem/`, | ||
| `rsync -a --ignore-errors --no-specials --no-devices --exclude='volume-backups/' ${BASE_PATH}/ ${tempDir}/filesystem/`, | ||
| ); | ||
|
Comment on lines
69
to
71
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Now that await execAsync(`rm -rf "${BASE_PATH}/"*`);This blanket deletion removes Consider updating the restore logic to preserve // Delete everything except volume-backups
await execAsync(`find "${BASE_PATH}" -maxdepth 1 -mindepth 1 ! -name 'volume-backups' -exec rm -rf {} +`); |
||
|
|
||
| writeStream.write("Copied filesystem to temp directory\n"); | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The pattern
--exclude='volume-backups/'will match a directory namedvolume-backups/at any depth withinBASE_PATH. While this works correctly today sincevolume-backups/only exists at the top level ofBASE_PATH, using a leading/anchors the pattern to the rsync source root and is more precise: