itamae/cookbooks/wekan/templates/home/wekan/app/mongodb-backup.sh
2019-03-03 16:50:49 +08:00

15 lines
188 B
Bash

#!/bin/bash
set -e
DIR=$(mktemp -d)
DATE=$(date "+%Y%m%d")
mongodump -v --out "${DIR}" -h <%= @ipaddr %>
tar cvzf "/tmp/wekan-mongodb-bk-${DATE}.tgz" "${DIR}"
rm -rf "${DIR}"
exit 0