Closed killmasta93 closed 9 months ago
I think you are confusing |
and &&
@nettnikl No, he is not. He wants to pipe the mongo dump into restic for backing it up, which is possible.
The problem is probably the escaping of the command. As a quick solution, I propose putting the command into a bash script and mounting the script into the restic container so you can run it instead.
So, something like this:
backup:
# ...
environment:
PRE_COMMANDS: |-
/usr/local/bin/backup_mongo.sh
volumes:
- ./backup_mongo.sh:/usr/local/bin/backup_mongo.sh
Thank you
Hi I was wondering if someone else has had this issue before currently i can use the pre command to backup mysql and postgre but cant seem to get it working on mongo this is what i have so far
docker exec -i 4minitz-mongo-1 /usr/bin/mongodump --gzip --archive=db.archive | restic backup --tag meetingsdb --stdin --stdin-filename db.archive
but it gives an our saying invalid
but if i run it manually it works fine
Thank you