-
-
Notifications
You must be signed in to change notification settings - Fork 94
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
Enhancements to the tar.gz #38
Comments
About your issue: I'm not sure where that is coming from. the filenames should be the same inside and outside the container. I am using the image like this for a very long time and have never seen something similar. Could I ask you for more details about your setup (compose file, OS, etc) so it might be possible for me to reproduce this? About your request: it would probably make sense to do this in the same way that Docker itself allows you to pass (Go) templates to commands for formatting (e.g. |
Ubuntu 20.04.3 LTS backup.env only has Thanks again! |
This looks ok on first glance. Would you mind also sharing the log output of a backup run? |
time="2021-12-17T14:54:15-05:00" level=info msg="Created backup of |
It's slightly surprising your filename is quoted inside the path: Could it be that your Docker version is slightly outdated and you are running into this issue: docker/compose#2854 which would mean your access keys are inadvertently quoted? You can test this easily by defining it like this:
instead of:
See: #6 (comment) |
Well nevermind. It was an issue with SMB and mangled names. I forgot to mention I was viewing the files over a share. Adding mangled names=no to my smb.conf seem to have fixed it. Maybe there is a trailing space somewhere. |
Client: Docker Engine - Community Version: 20.10.12 I changed it too; And the output became; time="2021-12-17T15:08:47-05:00" level=info msg="Created backup of That looks a lot better and I don't need the mangled names config either. Thanks! |
I guess I'll add a note about this to README considering you're not the first one to have been bitten by this. Good to know it's working for you now. I'll circle back here once I have made up my mind about that filename template. |
Maybe a very simple solution for enabling more flexible filenames would be expanding env vars in a template just like in POSIX using https://pkg.go.dev/os#ExpandEnv This would mean you could use BACKUP_FILENAME="$HOST-%Y-%m-%dT%H-%M-%S.tar.gz" in case you propagate (if you even want that) your host's $HOST into the container. |
The one thing I am still not sure about when implementing expansion of env vars is the following: it cannot be done by simply expanding vars as this is a breaking change (people might have filename patterns that accidentally get expanded with that addition). To make it an opt-in change I see 3 possibilities:
Maybe the first option would be the most straight-forward and least confusing, even if slightly ugly. |
This is now released in v2.7.0 |
One issue and one ask.
Ask - Is there a way to reference the docker server hostname in the backup file? E.g.
BACKUP_FILENAME="backup-%Y-%m-%dT%H-%M-%S.tar.gz"
BACKUP_FILENAME="{hostname}%Y-%m-%dT%H-%M-%S.tar.gz"
Issue - I have a volume mounted for /archive in my docker-composer file like this;
- mnt/backups:/archive
When I run a backup and check the folder on the docker server, the files look like this _PNSM6~H. If I look at the /archive folder from within the container, the tar.gz is named appropriately. How can I access the tar.gz files outside of the container?
Thank you
The text was updated successfully, but these errors were encountered: