export content script 6

This commit is contained in:
Valentin 2024-04-16 17:32:31 +02:00
parent e33b934cb0
commit 1840e32587
1 changed files with 3 additions and 2 deletions

View File

@ -23,10 +23,11 @@ if [[ "$answer" == "y" ]]; then
export_base_folder="/home/${user}/content_exports"
export_folder="${export_base_folder}/${site_name}_export_${current_date}"
mkdir -p "${export_folder}"
mysqldump -u directus -p"${db_password}" directus > "${export_folder}/db_${site_name}_${current_date}"
mysqldump -u directus -p"${db_password}" directus > "${export_folder}/db_${site_name}_${current_date}.sql"
cp -r /var/www/repositories/cms*/uploads "${export_folder}"
tar -czf "${export_folder}.tar.gz" -C "${export_base_folder}" .
chown -R "${user}:${user}" "${export_folder}"
rm -r "${export_folder}"
chown -R "${user}:${user}" "${export_base_folder}"
ssh_port=$(cat /etc/ssh/sshd_config | grep "Port " | sed 's/^Port //')
ip=$(hostname -I)