Notes rclone

Voir :

https://doc.ubuntu-fr.org/rclone

https://help.ovhcloud.com/csm/en-public-cloud-storage-s3-rclone?id=kb_article_view&sysparm_article=KB0047458

https://laboiteajb.fr/rclone/

Voir aussi :

AWS Cloud S3FS

https://blog.jamesreed.dev/synchronizing-and-backing-up-data

https://wiki.davidl.me/index.php?title=Rclone&mobileaction=toggle_view_desktop

https://forge.tedomum.net/tedomum/rclone/-/blob/master/vfs/vfs.md?ref_type=heads

Configuration

rclone config

Exemple pour FTP \ Avec rclone mount il est possible de monter un partage FTP (FTPFS) (à la manière du vieux curlftpfs)

~/.config/rclone/rclone.conf

[NAS_FTP] type = ftp host = 192.168.1.200 user = jean pass = uqx7ec7Ou0boW32Z5ro4AAAAAAAAAAAAA

Utilisation

rclone listremotes rclone lsd NAS_FTP:/PLOP/_ATRIER rclone lsf NAS_FTP:/PLOP/_ATRIER rclone ncdu NAS_FTP:/PLOP/_ATRIER rclone tree NAS_FTP:/PLOP/_ATRIER

Montage FUSE ftpfs

rclone mount --read-only NAS_FTP:/ ~/mnt/ftp # Ne rend pas la main

Montage d'un partage Web python3 -m http.server

rclone mount --vfs-cache-mode full HTTP_SHARE:/plop/ ~/mnt/http/

Servir les fichiers en HTTP (comme python3 -m http.server)

rclone serve http NAS_FTP:/PLOP/_ATRIER/ # Ne rend pas la main lftp http://localhost:8080/

Servir les fichiers en SFTP (SSH)

rclone serve sftp NAS_FTP: --authorized-keys ~/.ssh/authorized_keys # Ne rend pas la main sftp -i ~/.ssh/id_ed25519 -P 2022 localhost lftp sftp://localhost:2022

Servir les fichiers Webdav (HTTP)

rclone serve webdav NAS_FTP: lftp http://localhost:8080/

Changement de mot de passe

# cat ~/.config/rclone/rclone.conf
read -s PASS
rclone config update NAS_FTP pass="$PASS" --obscure

Rclone & Restic

Voir :

Notes sauvegardes backup avec Restic

https://anchor.host/wordpress-backups-with-rclone-and-restic/

https://www.bobek.cz/blog/2020/restic-rclone/

https://blog.cadena-it.com/uncategorized/rclone-serve-restic/

https://restic.net/blog/2018-04-01/rclone-backend/

https://rclone.org/commands/rclone_serve_restic/

https://braincoke.fr/blog/2020/06/backup-all-the-things-with-restic/#automation

Voir aussi:

https://github.com/restic/rest-server

https://github.com/leaf-node/kaya

https://www.syncany.org/

https://syncthing.net/

rclone serve restic -v seafile:backup -v export RESTIC_REPOSITORY=rest:http://localhost:8080/jibe export RESTIC_PASSWORD=yourpassword

Autres

Obtenir les credentials

$ ./cred -e prod -p plop_app
# Charger les variables dans l’ENV
$ source plop_app_prod

Lister les containers

$ rclone lsd remote:
5696724577562 0001-01-01 00:00:00 2889576 plopapp-attachments
37069125054 0001-01-01 00:00:00 21331 plopapp-data

Usage d’un container

$ rclone size remote:plopapp-data
Total objects: 21339
Total size: 34.534 GBytes (37080481061 Bytes)

Lister le contenu d’un container, avec détail

$ rclone lsl remote:plopapp-attachments
23120 2020-08-18 20:31:15.000000000 00000e66-e181-11ea-af6b-f2b6da1bea7e
7334413 2021-01-22 23:48:53.000000000 000022f8-5d04-11eb-9dac-6230d5188362
5257998 2020-05-27 19:46:31.000000000 000009d2-a042-11ea-8752-1ab7ebd07623
5182855 2020-05-25 22:12:04.000000000 00002f36-9ec4-11ea-9833-1ab7ebd07623
4577310 2020-10-13 19:32:00.000000000 00000b30-0d7a-11eb-a06b-2e9ba961dc28
174118 2021-02-08 09:45:31.000000000 00005046-69ea-11eb-bb70-7effcef53fc4
855897 2020-07-31 23:15:46.000000000 000014d6-d373-11ea-aef4-a21ce4653668
...

Lister les objets vieux de 2 jours maximum

$ rclone lsl remote:plopapp-attachments --max-age 2d
623376 2021-03-25 11:51:07.000000000 00003b88-8d58-11eb-a461-56fe6cbb2a01
656332 2021-03-25 11:51:07.000000000 0052e838-8d58-11eb-a461-56fe6cbb2a01
...

Supprimer les objets de 3 mois au minimum \ -n dry run, limiter la bande passante à 10Mbs

$ rclone delete remote:plopapp-attachments --min-age 3M -n --bwlimit 10M

Restreindre la bbande passante

export RCLONE_BWLIMIT=1M