Files
mkdocs/docs/Synology/dsm7/pcloud.md
2025-04-08 11:27:00 +02:00

155 lines
2.8 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Sauvegarde Synology NAS sur pCloud avec rClone
### Sur le Mac:
```bash
$ brew install rclone
```
```bash
$ rclone config
# remote
n) New remote
Enter name for new remote.
name> pcloud
Storage> 38
Option client_id.
client_id> # vide
Option client_secret.
client_secret> # vide
Edit advanced config
y/n> n
Use web browser to automatically authenticate rclone with remote?
y/n> y
S'identifier dans la fenêtre pCloud
Options:
- type: pcloud
- hostname: eapi.pcloud.com
- token: {"access_token":"UsdkHboizcI2oUxeCOqwAU5d4QKO8y508RCbVKLU8Y52wYbjEezS","token_type":"bearer","expiry":"0001-01-01T00:00:00Z"}
Keep this "pcloud" remote ?
y/e/d> y
# Token modifié
```
On récupère le contenu du fichier de config:
```bash
$ cat .config/rclone/rclone.conf
```
```
[pcloud]
type = pcloud
hostname = eapi.pcloud.com
token = {"access_token":"UsdkHboizcI2oUxeCOqwAU5d4QKO8y508RCbVKLU8Y52wYbjEezS","token_type":"bearer","expiry":"0001-01-01T00:00:00Z"}
# Token modifié
```
### Sur le NAS:
On installe rclone:
```bash
bruno@DS923:~$ wget https://rclone.org/install.sh
```
```bash
bruno@DS923:~$ sudo ./install.sh
```
On crée la config:
```bash
bruno@DS923:~$ rclone config touch
```
puis on l'édite:
```bash
bruno@DS923:~$ nano .config/rclone/rclone.conf
```
et on colle la config crée sur le mac:
```
[pcloud]
type = pcloud
hostname = eapi.pcloud.com
token = {"access_token":"UsdkHboizcI2oUxeCOqwAU5d4QKO8y508RCbVKLU8Y52wYbjEezS","token_type":"bearer","expiry":"0001-01-01T00:00:00Z"}
# Token modifié
```
On teste la configuration:
```bash
bruno@DS923:~$ rclone lsd pcloud:
-1 2021-05-03 14:16:15 -1 .dotfiles
-1 2023-10-30 07:20:28 -1 Animations
-1 2023-10-30 08:01:50 -1 Automatic Uploadb
-1 2019-07-24 13:40:00 -1 Backups
```
et on la sauvegarde:
```bash
bruno@DS923:~$ cp .config/rclone/rclone.conf /volume1/nas/rclone/rclone.conf
```
### Synchronisation:
On synchronise le dossier partagé **docker** dans pCloud:
Option:
`--dry-run` pour tester.
`-P` pour afficher la progression
```bash
# sudo nécessaire pour le docker Acme
bruno@DS923:~$ sudo rclone --config /var/services/homes/bruno/.config/rclone/rclone.conf sync /volume1/docker pcloud:Nas923/docker -v --log-file=/var/services/homes/bruno/Logs/rclone/journal.log --exclude "*{@eaDir/,Thumbs.db,.DS_Store}*" -P
```
### Tache planifiée:
Panneau de configuration -> Planificateur de taches
Créer > Tâche planifiée > Script défini par lutilisateur
```bash
bruno@DS923:~$ rclone --config /var/services/homes/bruno/.config/rclone/rclone.conf sync /volume1/docker pcloud:Nas923/docker -v --log-file=/var/services/homes/bruno/Logs/rclone/journal.log --exclude "*{@eaDir/,Thumbs.db,.DS_Store}*"
```
https://www.gozen-consulting.com/2023/12/09/comment-sauvegarder-synology-nas-sur-pcloud-avec-rclone/