pe que là ça fonctionne mieux ?
This commit is contained in:
parent
feb4a67d82
commit
37abb1e301
|
|
@ -27,7 +27,7 @@ if [[ "$answer" == "y" ]]; then
|
||||||
|
|
||||||
rm $backup_archive
|
rm $backup_archive
|
||||||
|
|
||||||
backup_directory="/home/${username}$(ls \"/home/${username}/\" | grep \"${site_name}_export\")"
|
backup_directory="/home/${username}/"$(ls "/home/${username}/" | grep "${site_name}_export")
|
||||||
db_export=$(ls "${backup_directory}/db"*)
|
db_export=$(ls "${backup_directory}/db"*)
|
||||||
|
|
||||||
db_password=$(cat /var/www/repositories/cms*/.env | grep DB_PASSWORD | sed "s/[^']*'\([^']*\)'.*/\1/")
|
db_password=$(cat /var/www/repositories/cms*/.env | grep DB_PASSWORD | sed "s/[^']*'\([^']*\)'.*/\1/")
|
||||||
|
|
@ -35,11 +35,11 @@ if [[ "$answer" == "y" ]]; then
|
||||||
mariadb -u directus "-p${db_password}" -e "DROP DATABASE IF EXISTS directus; CREATE DATABASE directus;"
|
mariadb -u directus "-p${db_password}" -e "DROP DATABASE IF EXISTS directus; CREATE DATABASE directus;"
|
||||||
mariadb -u directus "-p${db_password}" directus < $db_export
|
mariadb -u directus "-p${db_password}" directus < $db_export
|
||||||
|
|
||||||
cms_directory=$(ls /var/www/repository/cms*)
|
cms_directory="/var/www/repository/"$(ls /var/www/repository | grep cms)
|
||||||
|
|
||||||
mv -f "${backup_directory}/uploads" $cms_directory
|
mv -f "${backup_directory}/uploads" $cms_directory
|
||||||
|
|
||||||
rm -r backup_directory
|
rm -r $backup_directory
|
||||||
else
|
else
|
||||||
echo -e "${PURPLE}${BOLD}Please import a .tar.gz backup in /home/${username}${RESET}"
|
echo -e "${PURPLE}${BOLD}Please import a .tar.gz backup in /home/${username}${RESET}"
|
||||||
fi
|
fi
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue