mirror of
https://github.com/offen/docker-volume-backup.git
synced 2024-11-12 17:50:27 +01:00
Also expand env vars in pruning prefix if configured
This commit is contained in:
parent
c062710ce8
commit
32575c831e
@ -123,10 +123,10 @@ You can populate below template according to your requirements and use it as you
|
|||||||
# BACKUP_FILENAME="backup-%Y-%m-%dT%H-%M-%S.tar.gz"
|
# BACKUP_FILENAME="backup-%Y-%m-%dT%H-%M-%S.tar.gz"
|
||||||
|
|
||||||
# Setting BACKUP_FILENAME_EXPAND to true allows for environment variable
|
# Setting BACKUP_FILENAME_EXPAND to true allows for environment variable
|
||||||
# placeholders in BACKUP_FILENAME and in BACKUP_LATEST_SYMLINK that will get
|
# placeholders in BACKUP_FILENAME, BACKUP_LATEST_SYMLINK and in
|
||||||
# expanded at runtime, e.g. `backup-$HOSTNAME-%Y-%m-%dT%H-%M-%S.tar.gz`.
|
# BACKUP_PRUNING_PREFIX that will get expanded at runtime,
|
||||||
# Expansion happens before interpolating strftime tokens.
|
# e.g. `backup-$HOSTNAME-%Y-%m-%dT%H-%M-%S.tar.gz`. Expansion happens before
|
||||||
# It is disabled by default.
|
# interpolating strftime tokens. It is disabled by default.
|
||||||
# Please note that you will need to escape the `$` when providing the value
|
# Please note that you will need to escape the `$` when providing the value
|
||||||
# in a docker-compose.yml file, i.e. using $$VAR instead of $VAR.
|
# in a docker-compose.yml file, i.e. using $$VAR instead of $VAR.
|
||||||
|
|
||||||
|
@ -157,6 +157,7 @@ func newScript() (*script, error) {
|
|||||||
if s.c.BackupFilenameExpand {
|
if s.c.BackupFilenameExpand {
|
||||||
s.file = os.ExpandEnv(s.file)
|
s.file = os.ExpandEnv(s.file)
|
||||||
s.c.BackupLatestSymlink = os.ExpandEnv(s.c.BackupLatestSymlink)
|
s.c.BackupLatestSymlink = os.ExpandEnv(s.c.BackupLatestSymlink)
|
||||||
|
s.c.BackupPruningPrefix = os.ExpandEnv(s.c.BackupPruningPrefix)
|
||||||
}
|
}
|
||||||
s.file = timeutil.Strftime(&s.start, s.file)
|
s.file = timeutil.Strftime(&s.start, s.file)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user