Commit da02d2cdccbd7482b6c553975d8e95e108a1e008
1 parent
f8dcf69a
Exists in
master
and in
54 other branches
Remove wildcard when retrieving noosfero backup
Showing
1 changed file
with
7 additions
and
2 deletions
Show diff stats
cookbooks/backup/files/host-social/backup_spb.sh
1 | 1 | #!/bin/bash |
2 | + | |
3 | +set -e | |
4 | + | |
5 | +BKP_DIR=/usr/lib/noosfero/tmp/backup | |
6 | + | |
2 | 7 | cd /usr/lib/noosfero |
3 | 8 | RAILS_ENV=production sudo -u noosfero bundle exec rake backup |
4 | 9 | cd - |
5 | -# TODO fix regular expression | |
6 | -mv /usr/lib/noosfero/tmp/backup/*.tar.gz noosfero_backup.tar.gz | |
10 | +mv $BKP_DIR/`ls -tr $BKP_DIR | grep -E '[0-9]{4}-[0-9]{2}-[0-9]{2}-[0-9]{2}:[0-9]{2}\.tar\.gz' | tail -1` noosfero_backup.tar.gz | |
11 | + | ... | ... |