hs.scripts/rollback/nextcloud/rollback.sh

20 lines
533 B
Bash
Raw Permalink Normal View History

2024-04-25 13:49:12 +02:00
#!/bin/bash
set -e
if [ -z ${php} ]; then
php="php8.2"
fi
source $HOME/scripts/config.env
cd $HOME/nextcloud
$php occ maintenance:mode --on
echo "syncing data..."
rsync -aAX --delete /home/storage/$pac/users/$user/data_clean/ /home/storage/$pac/users/$user/data/
echo "syncing nextcloud..."
rsync -aAX --delete /home/pacs/$pac/users/$user/nextcloud_clean/ /home/pacs/$pac/users/$user/nextcloud/
echo "feeding the dump..."
pg_restore -c -h localhost -U $dbuser -d $db < $dump
$php occ maintenance:mode --off
echo
echo done.