mirror of
https://github.com/offen/docker-volume-backup.git
synced 2026-04-26 18:25:36 +02:00
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1e36bd3eb7 | ||
|
|
e93a74dd48 | ||
|
|
f799e6c2e9 |
14
.github/ISSUE_TEMPLATE/bug_report.md
vendored
14
.github/ISSUE_TEMPLATE/bug_report.md
vendored
@@ -8,7 +8,9 @@ assignees: ''
|
|||||||
---
|
---
|
||||||
|
|
||||||
**Describe the bug**
|
**Describe the bug**
|
||||||
|
<!--
|
||||||
A clear and concise description of what the bug is.
|
A clear and concise description of what the bug is.
|
||||||
|
-->
|
||||||
|
|
||||||
**To Reproduce**
|
**To Reproduce**
|
||||||
Steps to reproduce the behavior:
|
Steps to reproduce the behavior:
|
||||||
@@ -17,12 +19,16 @@ Steps to reproduce the behavior:
|
|||||||
3. ...
|
3. ...
|
||||||
|
|
||||||
**Expected behavior**
|
**Expected behavior**
|
||||||
|
<!--
|
||||||
A clear and concise description of what you expected to happen.
|
A clear and concise description of what you expected to happen.
|
||||||
|
-->
|
||||||
|
|
||||||
**Desktop (please complete the following information):**
|
**Version (please complete the following information):**
|
||||||
- Image Version: [e.g. v2.21.0]
|
- Image Version: <!-- e.g. v2.21.0 -->
|
||||||
- Docker Version: [e.g. 20.10.17]
|
- Docker Version: <!-- e.g. 20.10.17 -->
|
||||||
- Docker Compose Version (if applicable): [e.g. 1.29.2]
|
- Docker Compose Version (if applicable): <!-- e.g. 1.29.2 -->
|
||||||
|
|
||||||
**Additional context**
|
**Additional context**
|
||||||
|
<!--
|
||||||
Add any other context about the problem here.
|
Add any other context about the problem here.
|
||||||
|
-->
|
||||||
|
|||||||
8
.github/ISSUE_TEMPLATE/feature_request.md
vendored
8
.github/ISSUE_TEMPLATE/feature_request.md
vendored
@@ -8,13 +8,21 @@ assignees: ''
|
|||||||
---
|
---
|
||||||
|
|
||||||
**Is your feature request related to a problem? Please describe.**
|
**Is your feature request related to a problem? Please describe.**
|
||||||
|
<!--
|
||||||
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
|
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
|
||||||
|
-->
|
||||||
|
|
||||||
**Describe the solution you'd like**
|
**Describe the solution you'd like**
|
||||||
|
<!--
|
||||||
A clear and concise description of what you want to happen.
|
A clear and concise description of what you want to happen.
|
||||||
|
-->
|
||||||
|
|
||||||
**Describe alternatives you've considered**
|
**Describe alternatives you've considered**
|
||||||
|
<!--
|
||||||
A clear and concise description of any alternative solutions or features you've considered.
|
A clear and concise description of any alternative solutions or features you've considered.
|
||||||
|
-->
|
||||||
|
|
||||||
**Additional context**
|
**Additional context**
|
||||||
|
<!--
|
||||||
Add any other context or screenshots about the feature request here.
|
Add any other context or screenshots about the feature request here.
|
||||||
|
-->
|
||||||
|
|||||||
8
.github/ISSUE_TEMPLATE/support_request.md
vendored
8
.github/ISSUE_TEMPLATE/support_request.md
vendored
@@ -8,13 +8,21 @@ assignees: ''
|
|||||||
---
|
---
|
||||||
|
|
||||||
**What are you trying to do?**
|
**What are you trying to do?**
|
||||||
|
<!--
|
||||||
A clear and concise description of what you are trying to do, but cannot get working.
|
A clear and concise description of what you are trying to do, but cannot get working.
|
||||||
|
-->
|
||||||
|
|
||||||
**What is your current configuration?**
|
**What is your current configuration?**
|
||||||
|
<!--
|
||||||
Add the full configuration you are using. Please redact out any real-world credentials.
|
Add the full configuration you are using. Please redact out any real-world credentials.
|
||||||
|
-->
|
||||||
|
|
||||||
**Log output**
|
**Log output**
|
||||||
|
<!--
|
||||||
Provide the full log output of your setup.
|
Provide the full log output of your setup.
|
||||||
|
-->
|
||||||
|
|
||||||
**Additional context**
|
**Additional context**
|
||||||
|
<!--
|
||||||
Add any other context or screenshots about the support request here.
|
Add any other context or screenshots about the support request here.
|
||||||
|
-->
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
# docker-volume-backup
|
# docker-volume-backup
|
||||||
|
|
||||||
Backup Docker volumes locally or to any S3, WebDAV or SSH compatible storage.
|
Backup Docker volumes locally or to any S3, WebDAV, Azure Blob Storage or SSH compatible storage.
|
||||||
|
|
||||||
The [offen/docker-volume-backup](https://hub.docker.com/r/offen/docker-volume-backup) Docker image can be used as a lightweight (below 15MB) sidecar container to an existing Docker setup.
|
The [offen/docker-volume-backup](https://hub.docker.com/r/offen/docker-volume-backup) Docker image can be used as a lightweight (below 15MB) sidecar container to an existing Docker setup.
|
||||||
It handles __recurring or one-off backups of Docker volumes__ to a __local directory__, __any S3, WebDAV, Azure Blob Storage or SSH compatible storage (or any combination) and rotates away old backups__ if configured. It also supports __encrypting your backups using GPG__ and __sending notifications for failed backup runs__.
|
It handles __recurring or one-off backups of Docker volumes__ to a __local directory__, __any S3, WebDAV, Azure Blob Storage or SSH compatible storage (or any combination) and rotates away old backups__ if configured. It also supports __encrypting your backups using GPG__ and __sending notifications for failed backup runs__.
|
||||||
|
|||||||
@@ -67,15 +67,17 @@ func (b *webDavStorage) Name() string {
|
|||||||
|
|
||||||
// Copy copies the given file to the WebDav storage backend.
|
// Copy copies the given file to the WebDav storage backend.
|
||||||
func (b *webDavStorage) Copy(file string) error {
|
func (b *webDavStorage) Copy(file string) error {
|
||||||
bytes, err := os.ReadFile(file)
|
|
||||||
_, name := path.Split(file)
|
_, name := path.Split(file)
|
||||||
if err != nil {
|
|
||||||
return fmt.Errorf("(*webDavStorage).Copy: Error reading the file to be uploaded: %w", err)
|
|
||||||
}
|
|
||||||
if err := b.client.MkdirAll(b.DestinationPath, 0644); err != nil {
|
if err := b.client.MkdirAll(b.DestinationPath, 0644); err != nil {
|
||||||
return fmt.Errorf("(*webDavStorage).Copy: Error creating directory '%s' on WebDAV server: %w", b.DestinationPath, err)
|
return fmt.Errorf("(*webDavStorage).Copy: Error creating directory '%s' on WebDAV server: %w", b.DestinationPath, err)
|
||||||
}
|
}
|
||||||
if err := b.client.Write(filepath.Join(b.DestinationPath, name), bytes, 0644); err != nil {
|
|
||||||
|
r, err := os.Open(file)
|
||||||
|
if err != nil {
|
||||||
|
return fmt.Errorf("(*webDavStorage).Copy: Error opening the file to be uploaded: %w", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := b.client.WriteStream(filepath.Join(b.DestinationPath, name), r, 0644); err != nil {
|
||||||
return fmt.Errorf("(*webDavStorage).Copy: Error uploading the file to WebDAV server: %w", err)
|
return fmt.Errorf("(*webDavStorage).Copy: Error uploading the file to WebDAV server: %w", err)
|
||||||
}
|
}
|
||||||
b.Log(storage.LogLevelInfo, b.Name(), "Uploaded a copy of backup '%s' to WebDAV URL '%s' at path '%s'.", file, b.url, b.DestinationPath)
|
b.Log(storage.LogLevelInfo, b.Name(), "Uploaded a copy of backup '%s' to WebDAV URL '%s' at path '%s'.", file, b.url, b.DestinationPath)
|
||||||
|
|||||||
Reference in New Issue
Block a user