Montages Rclone Sasnexte et Kdrive
Montages Rclone Sasnexte et Kdrive
Architecture
NAS Sasnexte (Synology)
└── rclone sync (WebDAV) ──► kDrive Infomaniak
└── rclone mount (FUSE) ──► VPS Jux
└── containers Docker
Le NAS pousse les médias vers kDrive une fois par jour via le planificateur DSM. Le VPS monte kDrive en FUSE en permanence — les containers accèdent aux fichiers en lecture.
Remote rclone (NAS sasnexte)
Fichier : /volume1/homes/SAS_NEXTE/.config/rclone/rclone.conf
[kdrive_music]
type = webdav
url = https://591617.connect.kdrive.infomaniak.com
vendor = other
user = julien.bertrand@nexte.fr
pass = [obfusqué rclone]
Note : le remote s'appelle kdrive_music mais sert à synchroniser tous les contenus (musique, photos, audiobooks, Komga). Nom historique à ne pas confondre avec un remote dédié musique.
Script unifié (NAS sasnexte)
Emplacement : /volume1/homes/SAS_NEXTE/scripts/sync_kdrive_complete.sh
Planificateur DSM : tâche déclenchée quotidiennement
#!/bin/bash
# sync_kdrive_complete.sh — Synchronisation NAS sasnexte → kDrive
# Remote rclone : kdrive_music (WebDAV Infomaniak kDrive, compte nexte.fr)
RCLONE="/usr/local/bin/rclone"
REMOTE="kdrive_music"
LOG_DIR="/volume1/homes/SAS_NEXTE/logs"
DATE=$(date +%Y%m%d_%H%M%S)
SUMMARY_LOG="$LOG_DIR/sync_${DATE}.log"
mkdir -p "$LOG_DIR"
run_sync() {
local name="$1"
local source="$2"
local dest="${REMOTE}:${3}"
local log="$LOG_DIR/sync_${name}_${DATE}.log"
echo "[$(date '+%Y-%m-%d %H:%M:%S')] === Début $name ===" | tee -a "$SUMMARY_LOG"
sudo -u SAS_NEXTE "$RCLONE" sync "$source" "$dest" \
--delete-excluded \
--ignore-errors \
--delete-during \
--fast-list \
--exclude "@eaDir/**" \
--exclude "#recycle/**" \
--exclude "@__thumb/**" \
--exclude "*.@SynoResource" \
--exclude "*.@SynoEAStream" \
--transfers=4 \
--checkers=8 \
--timeout=5m \
--contimeout=2m \
--log-file="$log" \
-v
local rc=$?
echo "[$(date '+%Y-%m-%d %H:%M:%S')] === Fin $name (code=$rc) ===" | tee -a "$SUMMARY_LOG"
}
run_sync "audiobooks" "/volume1/audiobooks" "SYNC-pour_VPS/Sync-SASNEXTE/audiobooks"
run_sync "music" "/volume1/music" "SYNC-pour_VPS/Sync-SASNEXTE/music"
run_sync "photo" "/volume1/photo/2026" "SYNC-pour_VPS/Sync-SASNEXTE/photo/2026"
run_sync "komga" "/volume1/Komga" "SYNC-pour_VPS/Sync-SASNEXTE/Komga"
Syncs actifs
| Nom | Source NAS | Destination kDrive | Notes |
|---|---|---|---|
| audiobooks | /volume1/audiobooks |
SYNC-pour_VPS/Sync-SASNEXTE/audiobooks |
|
| music | /volume1/music |
SYNC-pour_VPS/Sync-SASNEXTE/music |
|
| photo | /volume1/photo/2026 |
SYNC-pour_VPS/Sync-SASNEXTE/photo/2026 |
Année courante seulement |
| komga | /volume1/Komga |
SYNC-pour_VPS/Sync-SASNEXTE/Komga |
Non géré ici :
- Romans : abandonné
- Foxy : sur NAS Maison (pas sasnexte)
Options rclone — justifications
| Option | Rôle |
|---|---|
--delete-excluded |
Supprime sur kDrive les fichiers exclus qui auraient pu y être uploadés |
--ignore-errors |
Poursuit la sync si un fichier est inaccessible (NAS Synology parfois occupé) |
--delete-during |
Supprime les fichiers obsolètes au fil du scan, pas en fin de run |
--fast-list |
Réduit les appels API WebDAV (un seul listing récursif) |
@eaDir/** |
Dossiers de métadonnées Synology (miniatures) |
#recycle/** |
Corbeille Synology |
@__thumb/** |
Miniatures Synology |
*.@SynoResource / *.@SynoEAStream |
Flux de ressources étendues Synology |
--transfers=4 |
4 fichiers en parallèle — équilibre entre perf et charge WebDAV |
--checkers=8 |
8 vérifications de hash en parallèle |
--timeout=5m |
Timeout par opération I/O |
--contimeout=2m |
Timeout de connexion initiale |
Côté VPS — montages FUSE correspondants
Les services systemd sur le VPS montent les dossiers kDrive en FUSE :
| Service systemd | Point de montage | Source kDrive |
|---|---|---|
rclone-audiobookshelf.service |
/home/debian/audiobookshelf/audiobooks |
SYNC-pour_VPS/Sync-SASNEXTE/audiobooks |
kdrive-music.service |
/home/debian/music |
SYNC-pour_VPS/Sync-SASNEXTE/music |
rclone-photo.service |
/home/debian/photo |
SYNC-pour_VPS/Sync-SASNEXTE/photo |
kdrive-komga.service |
/home/debian/komga |
SYNC-pour_VPS/Sync-SASNEXTE/Komga |
Remote VPS : kdrive: — remote natif Infomaniak (@infomaniak/mcp-server-kdrive), compte julien.bertrand@live.fr, kDrive ID 591617.
Logs
- Un fichier de log par sync par run :
$LOG_DIR/sync_{nom}_{date}.log - Bilan global :
$LOG_DIR/sync_{date}.log - Répertoire :
/volume1/homes/SAS_NEXTE/logs/