This commit is contained in:
2025-05-27 03:38:18 -05:00
parent 990ad5285b
commit c60eab694a
27 changed files with 463 additions and 129 deletions
+3 -41
View File
@@ -1,44 +1,6 @@
#!/bin/bash
set -e
echo "Starting rclone synchronization at $(date)"
# Function to sync to Google Drive
sync_to_gdrive() {
local src=$1
local dest=$2
echo "Syncing $src to Google Drive (gdrive:$dest)"
rclone sync "$src" "gdrive:$dest" --progress --transfers=4 --checkers=8 --exclude "*.{db,db-shm,db-wal}" --log-level INFO
}
# Function to sync to Internet Archive (only .scroll, .seal, .typ, and .tex files)
sync_to_ia() {
local src=$1
local dest=$2
echo "Syncing $src to Internet Archive (ia:$dest)"
rclone sync "$src" "ia:$dest" --progress --transfers=4 --checkers=8 --wait-archive=1h --include "*.{scroll,seal,typ,tex}" --log-level INFO
}
# Function to sync to Web3.storage
sync_to_web3() {
local src=$1
local dest=$2
if [ -d "$src" ]; then
echo "Syncing $src to Web3.storage (web3:$dest)"
rclone sync "$src" "web3:$dest" --progress --transfers=4 --checkers=8 --log-level INFO
else
echo "$src directory not found, skipping Web3.storage sync"
fi
}
# Sync working drafts to Google Drive
sync_to_gdrive "/data/scrolls" "fold-stack/scrolls"
sync_to_gdrive "/data/hedgedoc/uploads" "fold-stack/hedgedoc_uploads"
# Sync scrolls/seals/typ/tex to Internet Archive
sync_to_ia "/data/scrolls" "fold-stack-scrolls"
# Sync Trilium backups to Web3.storage
sync_to_web3 "/data/trilium-backup" "fold-stack-trilium"
echo "Synchronization completed at $(date)"
echo "Starting rclone sync at $(date)"
rclone sync /data nextcloud:/ --config=/config/rclone/rclone.conf --log-level INFO --log-file=/data/rclone.log
echo "Rclone sync completed at $(date)"