Last active
October 11, 2025 16:51
-
-
Save Daij-Djan/5fdde2603eeb742c8f8ec5a8125f6f7c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # Dropbox β Nextcloud import script for <<USER>> | |
| # ----------------------------------------------- | |
| set -euo pipefail | |
| BASE_DIR="/home/roesrathkleineichen/domains/<<DESTINATION>>" | |
| RCLONE="/usr/bin/rclone" | |
| PHP="/usr/bin/php" | |
| cd "$BASE_DIR" || { echo "β Failed to cd to $BASE_DIR"; exit 1; } | |
| echo "=============" | |
| echo "π¦ Import from Dropbox for <<USER>> @ $(date)" | |
| echo | |
| FOLDERS=( | |
| "Apps" | |
| "Camera Uploads" | |
| "Camera Uploads Old" | |
| "Documents" | |
| "Music" | |
| "Videos" | |
| "Photos" | |
| "Sources" | |
| "Websites" | |
| ) | |
| for FOLDER in "${FOLDERS[@]}"; do | |
| echo "β‘οΈ Syncing '$FOLDER'..." | |
| if $RCLONE sync -v "dropbox:/$FOLDER" "data/<<USER>>/files/$FOLDER"; then | |
| echo "β Finished syncing '$FOLDER'" | |
| else | |
| echo "β οΈ Failed to sync '$FOLDER'" | |
| fi | |
| echo | |
| done | |
| echo "=============" | |
| echo "π Reindexing Nextcloud files..." | |
| $PHP occ files:scan --all | |
| $PHP occ files:cleanup | |
| echo "β Reindex complete" | |
| echo "=============" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment