-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
JS Fillman
committed
Apr 3, 2024
1 parent
b4d7aa4
commit 81959b7
Showing
3 changed files
with
145 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
|
||
## Zip2Cloud | ||
|
||
A robust zip & upload utility for sending archives to a remote location. | ||
|
||
### Features | ||
|
||
- Intelligently compares local & remote files with md5 sums | ||
- Only uploads _completed_ archives | ||
- Only deletes local files once they have been successfully uploaded | ||
- Allows keeping an arbitrary amount of zipped & unzipped backups locally for faster restore | ||
- Script only zips & uploads files that are missing from the remote location | ||
- Allows mixing backup files with other data | ||
- Only zips folders under the `$DUMP_BASE` directory with a date-based name e.g. `2024-04-01` | ||
- Notifies on completion or error via Slack | ||
|
||
### Operation of `zip2cloud` | ||
|
||
- Uses `rclone` to create a list of `.7z` & `.md5` files from the remote location defined with the `REMOTE` environment variable | ||
- For each file in the list | ||
|
||
- Compares file names & md5 sums between local & remote locations prior to read/write operations | ||
- Uploads any `.7z` files that are missing from the remote location | ||
- Files with mismatched md5 sums are uploaded with alternate filenames | ||
- Only deletes files locally once they have been successfully uploaded & md5 sums confirmed | ||
- Allows multiple unzipped local backups to remain, without re-zipping & uploading | ||
- This allows for faster restores, as we can avoid downloading the most recent archives | ||
- | ||
|
||
1. Creates 7zip archives of any directories under the `$DUMP_BASE` with a date-based name | ||
- For example, if `$DUMP_BASE` is `/dump/full_backup`, the directory `2024-04-01` will | ||
2. Syncs the archives to a remote location using rclone | ||
|
||
### Variables | ||
|
||
- `DUMP_BASE` - The base directory for backup dumps (default `/dump`) | ||
- `DUMP_RETENTION` - The number of days to keep uncompressed backups locally | ||
- `REMOTE` - The remote location to sync backups to | ||
- `SECRET` - The encryption key for 7zip | ||
- `SLACK_CHANNEL` - The slack channel to send notifications to | ||
- `SLACK_WEBHOOK` - The webhook URL for slack notifications | ||
- `ZIP_BASE` - The base filename, minus date, for the compressed backups | ||
- `ZIP_DIR` - The directory to store all compressed backups (default `/zip`) | ||
- `ZIP_RETENTION` - The number of days to keep compressed backups locally |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters