Backup and restore nodejs file

This commit is contained in:
Bob Mottram 2016-11-04 14:18:45 +00:00
parent 54c19d0d33
commit 9074a7cc2f
4 changed files with 14 additions and 0 deletions

View File

@ -249,6 +249,9 @@ function backup_configfiles {
if [ ! -d $temp_backup_dir ]; then if [ ! -d $temp_backup_dir ]; then
mkdir -p $temp_backup_dir mkdir -p $temp_backup_dir
fi fi
if [ -f $NODEJS_INSTALLED_APPS_FILE ]; then
cp -f $NODEJS_INSTALLED_APPS_FILE $temp_backup_dir
fi
cp -f $CONFIGURATION_FILE $temp_backup_dir cp -f $CONFIGURATION_FILE $temp_backup_dir
cp -f $COMPLETION_FILE $temp_backup_dir cp -f $COMPLETION_FILE $temp_backup_dir
if [ -f $BACKUP_EXTRA_DIRECTORIES ]; then if [ -f $BACKUP_EXTRA_DIRECTORIES ]; then

View File

@ -114,6 +114,9 @@ function backup_configfiles {
if [ ! -d $temp_backup_dir ]; then if [ ! -d $temp_backup_dir ]; then
mkdir -p $temp_backup_dir mkdir -p $temp_backup_dir
fi fi
if [ -f $NODEJS_INSTALLED_APPS_FILE ]; then
cp -f $NODEJS_INSTALLED_APPS_FILE $temp_backup_dir
fi
cp -f $CONFIGURATION_FILE $temp_backup_dir cp -f $CONFIGURATION_FILE $temp_backup_dir
cp -f $COMPLETION_FILE $temp_backup_dir cp -f $COMPLETION_FILE $temp_backup_dir
if [ -f $BACKUP_EXTRA_DIRECTORIES ]; then if [ -f $BACKUP_EXTRA_DIRECTORIES ]; then

View File

@ -108,6 +108,10 @@ function restore_configfiles {
temp_restore_dir=/root/tempconfig temp_restore_dir=/root/tempconfig
restore_directory_from_usb $temp_restore_dir configfiles restore_directory_from_usb $temp_restore_dir configfiles
if [ -f $temp_restore_dir$NODEJS_INSTALLED_APPS_FILE ]; then
cp -f $temp_restore_dir$NODEJS_INSTALLED_APPS_FILE $NODEJS_INSTALLED_APPS_FILE
fi
if [ -f $temp_restore_dir/root/${PROJECT_NAME}.cfg ]; then if [ -f $temp_restore_dir/root/${PROJECT_NAME}.cfg ]; then
cp -f $temp_restore_dir/root/${PROJECT_NAME}.cfg $CONFIGURATION_FILE cp -f $temp_restore_dir/root/${PROJECT_NAME}.cfg $CONFIGURATION_FILE
if [ ! "$?" = "0" ]; then if [ ! "$?" = "0" ]; then

View File

@ -115,6 +115,10 @@ function restore_configfiles {
temp_restore_dir=/root/tempconfig temp_restore_dir=/root/tempconfig
restore_directory_from_friend $temp_restore_dir configfiles restore_directory_from_friend $temp_restore_dir configfiles
if [ -f $temp_restore_dir$NODEJS_INSTALLED_APPS_FILE ]; then
cp -f $temp_restore_dir$NODEJS_INSTALLED_APPS_FILE $NODEJS_INSTALLED_APPS_FILE
fi
if [ -f $temp_restore_dir/root/${PROJECT_NAME}.cfg ]; then if [ -f $temp_restore_dir/root/${PROJECT_NAME}.cfg ]; then
cp -f $temp_restore_dir/root/${PROJECT_NAME}.cfg $CONFIGURATION_FILE cp -f $temp_restore_dir/root/${PROJECT_NAME}.cfg $CONFIGURATION_FILE
if [ ! "$?" = "0" ]; then if [ ! "$?" = "0" ]; then