Skip to content
Snippets Groups Projects

WIP: Resolve "Restore from legacy backup"

Open Michel Memeteau requested to merge 182-restore-from-legacy-backup into master
Compare and Show latest version
2 files
+ 23
12
Compare changes
  • Side-by-side
  • Inline
Files
2
+ 10
6
@@ -9,7 +9,7 @@
#- Warning: sshpass package has to be installed.
#-- File where host user's password is stored during script is runnung:
PSWDFILE=".nopaswd"
PSWDFILE=".nopasswd"
#=== Functions ===================================================================#
@@ -52,7 +52,9 @@ function main_proc ()
#--- Command for testing not asking ssh connexion password:
function testsshnopass ()
{
sshpass -p `cat $PSWDFILE` ssh -p $HOST_PORT ${HOST_USER}@$HOST_NAME "ls"
sudo apt install sshpass -y
}
@@ -66,12 +68,13 @@ function set_app_directories ()
APP_DIRS=( "_data/i" "upload" "local/config" ) ;
;;
prestashop)
APP_DIR="/var/www/html" ;
APP_DIRS=( "" ) ;
# See for 1.7 https://devdocs.prestashop.com/1.7/development/architecture/
APP_DIR="/var/www/" ;
APP_DIRS=( "shop" ) ;
;;
nextcloud)
APP_DIR="" ;
APP_DIRS=( "" ) ;
APP_DIR="/var/www/nextcloud" ;
APP_DIRS=( "apps" "custom_apps" "config" "data" ) ;
;;
esac
}
@@ -111,7 +114,8 @@ function download_archives ()
echo ""
echo "*** Start downloading data archives (be patient)... ***"
sshpass -p `cat $PSWDFILE` scp -P $HOST_PORT ${HOST_USER}@$HOST_NAME:${HOST_USER_DIR}/${APP_NAME}*.tgz .
$SSHNOPASS "rm -f ${HOST_USER_DIR}/${APP_NAME}*.tgz"
#TODO : test if transfer was OK
#$SSHNOPASS "rm -f ${HOST_USER_DIR}/${APP_NAME}*.tgz"
echo "*** Archives ${APP_NAME}*.tgz downloaded! ***"
#-- Download application's database dump:
Loading