Backup and restore files containing list of mongodb apps
This commit is contained in:
parent
e500a0de3b
commit
5acbc67460
|
@ -31,6 +31,7 @@
|
|||
PROJECT_NAME='freedombone'
|
||||
COMPLETION_FILE=$HOME/${PROJECT_NAME}-completed.txt
|
||||
CONFIGURATION_FILE=$HOME/${PROJECT_NAME}.cfg
|
||||
MONGODB_APPS_FILE=$HOME/.mongodbapps
|
||||
BACKUP_EXTRA_DIRECTORIES=/root/backup-extra-dirs.csv
|
||||
ENABLE_BACKUP_VERIFICATION="no"
|
||||
|
||||
|
@ -296,6 +297,9 @@ function backup_configfiles {
|
|||
if [ -f $BACKUP_EXTRA_DIRECTORIES ]; then
|
||||
cp -f $BACKUP_EXTRA_DIRECTORIES $temp_backup_dir
|
||||
fi
|
||||
if [ -f $MONGODB_APPS_FILE ]; then
|
||||
cp -f $MONGODB_APPS_FILE $temp_backup_dir
|
||||
fi
|
||||
# nginx password hashes
|
||||
if [ -f /etc/nginx/.htpasswd ]; then
|
||||
cp -f /etc/nginx/.htpasswd $temp_backup_dir/htpasswd
|
||||
|
|
|
@ -31,6 +31,7 @@
|
|||
PROJECT_NAME='freedombone'
|
||||
COMPLETION_FILE=$HOME/${PROJECT_NAME}-completed.txt
|
||||
CONFIGURATION_FILE=$HOME/${PROJECT_NAME}.cfg
|
||||
MONGODB_APPS_FILE=$HOME/.mongodbapps
|
||||
BACKUP_EXTRA_DIRECTORIES=/root/backup-extra-dirs.csv
|
||||
ENABLE_VERIFICATION="no"
|
||||
|
||||
|
@ -142,6 +143,9 @@ function backup_configfiles {
|
|||
if [ -f $BACKUP_EXTRA_DIRECTORIES ]; then
|
||||
cp -f $BACKUP_EXTRA_DIRECTORIES $temp_backup_dir
|
||||
fi
|
||||
if [ -f $MONGODB_APPS_FILE ]; then
|
||||
cp -f $MONGODB_APPS_FILE $temp_backup_dir
|
||||
fi
|
||||
# nginx password hashes
|
||||
if [ -f /etc/nginx/.htpasswd ]; then
|
||||
cp -f /etc/nginx/.htpasswd $temp_backup_dir/htpasswd
|
||||
|
|
|
@ -30,6 +30,7 @@
|
|||
|
||||
PROJECT_NAME='freedombone'
|
||||
COMPLETION_FILE=$HOME/${PROJECT_NAME}-completed.txt
|
||||
MONGODB_APPS_FILE=$HOME/.mongodbapps
|
||||
CONFIGURATION_FILE=$HOME/${PROJECT_NAME}.cfg
|
||||
BACKUP_EXTRA_DIRECTORIES=/root/backup-extra-dirs.csv
|
||||
|
||||
|
@ -184,6 +185,16 @@ function restore_configfiles {
|
|||
# fi
|
||||
#fi
|
||||
|
||||
if [ -f $temp_restore_dir$MONGODB_APPS_FILE ]; then
|
||||
cp -f $temp_restore_dir$MONGODB_APPS_FILE $MONGODB_APPS_FILE
|
||||
if [ ! "$?" = "0" ]; then
|
||||
set_user_permissions
|
||||
backup_unmount_drive
|
||||
rm -rf $temp_restore_dir
|
||||
exit 859034853
|
||||
fi
|
||||
fi
|
||||
|
||||
#if [ -f $CONFIGURATION_FILE ]; then
|
||||
# # install according to the config file
|
||||
# freedombone -c $CONFIGURATION_FILE
|
||||
|
|
|
@ -31,6 +31,7 @@
|
|||
PROJECT_NAME='freedombone'
|
||||
COMPLETION_FILE=$HOME/${PROJECT_NAME}-completed.txt
|
||||
CONFIGURATION_FILE=$HOME/${PROJECT_NAME}.cfg
|
||||
MONGODB_APPS_FILE=$HOME/.mongodbapps
|
||||
BACKUP_EXTRA_DIRECTORIES=/root/backup-extra-dirs.csv
|
||||
|
||||
export TEXTDOMAIN=${PROJECT_NAME}-restore-remote
|
||||
|
@ -172,6 +173,15 @@ function restore_configfiles {
|
|||
# fi
|
||||
#fi
|
||||
|
||||
if [ -f $temp_restore_dir$MONGODB_APPS_FILE ]; then
|
||||
cp -f $temp_restore_dir$MONGODB_APPS_FILE $MONGODB_APPS_FILE
|
||||
if [ ! "$?" = "0" ]; then
|
||||
unmount_drive
|
||||
rm -rf $temp_restore_dir
|
||||
exit 7835335
|
||||
fi
|
||||
fi
|
||||
|
||||
#if [ -f $CONFIGURATION_FILE ]; then
|
||||
# # install according to the config file
|
||||
# freedombone -c $CONFIGURATION_FILE
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
|
||||
# Set this when calling backup and restore commands
|
||||
USE_MONGODB=
|
||||
MONGODB_APPS_FILE=/root/.mongodbapps
|
||||
MONGODB_APPS_FILE=$HOME/.mongodbapps
|
||||
|
||||
function store_original_mongodb_password {
|
||||
if [ ! -f /root/.mongodboriginal ]; then
|
||||
|
|
Loading…
Reference in New Issue