Skip to content

Commit e66c4a9

Browse files
Luiz Gustavo Ferraz Aoquireevejd
authored andcommitted
Allow excluding paths on file backup (#3)
Add `BACKUP_LOCAL_PATHS_EXCLUDE`
1 parent 566eb05 commit e66c4a9

File tree

2 files changed

+15
-4
lines changed

2 files changed

+15
-4
lines changed

CHANGELOG.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
77

88
## [Unreleased][]
99

10+
## [1.2.0][] - 2019-06-14
11+
12+
### Added
13+
14+
- `BACKUP_LOCAL_PATHS_EXCLUDE` variable to allow excluding paths for file backup
15+
1016
## [1.1.0][] - 2019-05-24
1117

1218
### Added
@@ -99,7 +105,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
99105
- Upload to Softlayer
100106
- Travis CI for continuous integration
101107

102-
[unreleased]: https://github.ibm.com/bdu/gamora/compare/1.1.0...HEAD
108+
[unreleased]: https://github.ibm.com/bdu/gamora/compare/1.2.0...HEAD
109+
[1.2.0]: https://github.ibm.com/bdu/gamora/compare/1.1.0...1.2.0
103110
[1.1.0]: https://github.ibm.com/bdu/gamora/compare/1.0.1...1.1.0
104111
[1.0.1]: https://github.ibm.com/bdu/gamora/compare/1.0.0...1.0.1
105112
[1.0.0]: https://github.ibm.com/bdu/gamora/compare/0.3.2...1.0.0

gamora/docker-entrypoint.sh

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -185,9 +185,13 @@ back_up_files() {
185185

186186
log "Taking file backup"
187187
# shellcheck disable=SC2086
188-
monsoon "${NOTIFICATION_SETTINGS[@]}" backup files \
189-
--output="${BACKUP_PATH:?}/${filename}" \
190-
${BACKUP_LOCAL_PATHS:?} # space-separated list
188+
cmd="monsoon ${NOTIFICATION_SETTINGS[@]} backup files \
189+
--output=\"${BACKUP_PATH:?}/${filename}\""
190+
for f in ${BACKUP_LOCAL_PATHS_EXCLUDE:-}; do
191+
cmd="${cmd} --exclude=\"${f}\""
192+
done
193+
cmd="${cmd} ${BACKUP_LOCAL_PATHS:?}" # space-separated list
194+
eval $cmd
191195
log "Done: Taking file backup"
192196

193197
upload_backup "${filename:?}"

0 commit comments

Comments
 (0)