Server-Stuff/remove-data.sh

20 lines
555 B
Bash

# Stop the containers
docker compose down
# Remove the existing data (this will delete any partial installation)
sudo rm -rf /mnt/nextcloud/data/*
sudo rm -rf /mnt/nextcloud/data/.[!.]* # Remove hidden files too
# Also clean the nextcloud volume to start fresh
docker volume rm nextcloud_nextcloud
# Recreate the data directory with correct permissions
sudo mkdir -p /mnt/nextcloud/data
sudo chown -R 33:33 /mnt/nextcloud/data
sudo chmod -R 750 /mnt/nextcloud/data
# Start again
docker compose up -d
# Watch the logs
docker compose logs -f nextcloud