| config/mongodb.cfg | ●●●●● patch | view | raw | blame | history | |
| dbb-modules/mariadb | ●●●●● patch | view | raw | blame | history | |
| dbb-modules/mongodb | ●●●●● patch | view | raw | blame | history |
config/mongodb.cfg
@@ -1,11 +1,13 @@ ################################################################################ # ToDo MONGODB_BACKUP_LOCAL=FALSE MONGODB_BACKUP=FALSE ################################################################################ # ToDo MONGODB_BACKUP_REMOTE=FALSE MONGODB_SINGLE_BACKUP=FALSE ################################################################################ MONGODB_FULL_BACKUP=FALSE ################################################################################ dbb-modules/mariadb
@@ -2,11 +2,10 @@ # MariaBD/MySQL remote # # The Information what MySQL/MariaDB - databases should be backuped are defined in ~/.my.cnf # The Information what MySQL/MariaDB - databases should be backuped are defined in ~/.my.cnf-dbname # # note:for MARIADB in $(ls .my.cnf-* | cut -d "-" -f2); do mysqldump --defaults-file="~/.my.cnf-$MARIADB" --skip-dump-date $MARIADB > $TMP_DIR/$(cat ~/.my.cnf-$DATABASE | grep host | cut -d "=" -f2); done # note: for each MySQL- or MariaDB-Database create a seperate configfile .my.cnf-dbname ind the ~ of the backupuser: # note: replase the suffixe -dbname with the name of the database. The seperating "-" can also be a ".". # note: for each MySQL- or MariaDB-Database create a seperate configfile .my.cnf-dbname in the ~ of the backupuser: # note: replace the suffixe -dbname with the name of the database. The seperating "-" can also be a ".". # [mysqldump] # host=HOSTNAME # user=DBUSERNAME dbb-modules/mongodb
@@ -1,5 +1,43 @@ #!/bin/bash function run_mongodb_backup { echo "" ############################ # CAUTION WORK IN PROGRESS # # Will not work yet! # ############################ function check_mongodb_deps { if [ ! -e if [ -r ~/.mongorc.js ]; then debug "function check_mongodb_deps: ~/.mongorc.js exists, doing backup." else debug "function check_mongodb_deps: ~/mongorc.js does not exists. Aborting mongodb-backup." MONGODB_BACKUP=FALSE fi } function mongodb_single_backup { if [ ${M_DB_LIST} ]; then echo "backup ${M_DB}" for M_DB in ${M_DB_LIST} ; do mongodump --port=${M_PORT} --ssl --sslCAFile=${M_SSL_CERT_FILE} --host=${M_HOST} --username=${M_USER} --authenticationDatabase=${M_AUTH_DB} --password=${M_USER_PWD} --db=${M_DB} -o ${BACKUPDIR}/"${TIMESTAMP}"_"${M_HOST}"_"${M_DB}" done fi } function mongodb_full_backup { mongodump --port=${M_PORT} -ssl --sslCAFile=${M_SSL_CERT_FILE} --host=${M_HOST} --username=${M_USER} --authenticationDatabase=${M_AUTH_DB} --password=${M_USER_PWD} -o ${BACKUPDIR}/"${TIMESTAMP}"_"${M_HOST}" } function mongodb_backup_main { check_mongodb_deps if [ "$MONGODB_BACKUP" = "TRUE" ]; then # check and do singledatabasebackup if [ "$MONGODB_SINGLE_BACKUP" = "TRUE" ]; then mongodb_single_backup fi # check an do completedatabasebackup if [ "$MONGODB_FULL_BACKUP" = "TRUE" ]; then mongodb_full_backup fi fi }