Moving mongo backups

This commit is contained in:
Samuel Clay 2022-02-03 13:49:23 -05:00
parent eadcfc4426
commit 58abe3792e
2 changed files with 4 additions and 4 deletions

View file

@ -65,8 +65,8 @@
- name: Create symlink to mounted volume for backups to live
file:
state: link
src: "/mnt/{{ inventory_hostname | regex_replace('db-|-', '') }}/backup/"
path: /srv/newsblur/docker/backup
src: "/mnt/{{ inventory_hostname | regex_replace('db-|-', '') }}/backup"
path: /srv/newsblur/backup/
- name: Start db-mongo docker container
become: yes

View file

@ -41,7 +41,7 @@ collections=(
user_search
)
if [ $1 == "stories" ]; then
if [ $1 = "stories" ]; then
collections+=(
shared_stories
starred_stories
@ -52,7 +52,7 @@ for collection in ${collections[@]}; do
now=$(date '+%Y-%m-%d-%H-%M')
echo "---> Dumping $collection - ${now}"
docker exec -it mongo mongodump -d newsblur -c $collection -o /srv/newsblur/backup/backup_mongo
docker exec -it mongo mongodump -d newsblur -c $collection -o /backup
done;
echo " ---> Compressing /srv/newsblur/backup/backup_mongo into /srv/newsblur/backup/backup_mongo.tgz"