Salut, je passe par PlexDrive => https://github.com/dweidenfeld/plexdrive/blob/master/TUTORIAL.md
Ça te donne un rclone.conf de ce genre
[gdrive]
type = drive
client_id =
client_secret =
token = {"access_token":"xxx"}
[gcrypt]
type = crypt
remote = gdrive:/Enc
filename_encryption = standard
password = aaa
password2 = bbb
[crypt]
type = crypt
remote = /home/aerya/mnt/plexdrive/
filename_encryption = standard
directory_name_encryption = true
password = ccc
password2 = ddd
Et ensuite rClone et PlexDrive sont tous les deux montés dans /unionfs où tout arrive et tout est lu.
Les scripts
rclone-encrypt.sh
#!/bin/bash
rclone --uid=1000 --gid=1000 --allow-non-empty --allow-other mount crypt: /home/aerya/mnt/encrypt --size-only
rclone-en.sh
#!/bin/bash
rclone --uid=1000 --gid=1000 --allow-non-empty --allow-other mount gcrypt: /home/aerya/mnt/.gcrypt --size-only
rclone.sh
#!/bin/bash
rclone --uid=1000 --gid=1000 --allow-non-empty --allow-other mount gdrive: /home/aerya/mnt/gdrive --size-only
Les services
move-en.service
[Unit]
Description=Move Service Daemon
After=multi-user.target
[Service]
Type=simple
User=0
Group=0
ExecStart=/bin/bash /home/aerya/scripts/move-en.sh
TimeoutStopSec=20
KillMode=process
RemainAfterExit=yes
Restart=always
[Install]
WantedBy=multi-user.target
plexdrive.service
[Unit]
Description=PlexDrive5 Service
After=network-online.target
[Service]
Type=simple
ExecStart=/usr/local/bin/plexdrive mount --uid=1000 --gid=1000 -v 5 --fuse-options=allow_other,read_only,allow_non_empty_mount --config=/root/.plexdrive --cache-file=/root/.plexdrive/cache.bolt /home/aerya/mnt/plexdrive
ExecStop=/bin/fusermount -uz /home/aerya/mnt/plexdrive
RemainAfterExit=yes
Restart=always
RestartSec=5
[Install]
WantedBy=default.target
rclone-encrypt.service
[Unit]
Description=RClone Daemon
After=multi-user.target
[Service]
Type=simple
User=0
Group=0
ExecStart=/bin/bash /home/aerya/scripts/rclone-encrypt.sh
ExecStop=/bin/fusermount -uz /home/aerya/mnt/encrypt
TimeoutStopSec=20
KillMode=process
RemainAfterExit=yes
Restart=always
[Install]
WantedBy=multi-user.target
rclone-en.service
[Unit]
Description=RClone Daemon
After=multi-user.target
[Service]
Type=simple
User=0
Group=0
ExecStart=/bin/bash /home/aerya/scripts/rclone-en.sh
ExecStop=/bin/fusermount -uz /home/aerya/mnt/.gcrypt
TimeoutStopSec=20
KillMode=process
RemainAfterExit=yes
Restart=always
[Install]
WantedBy=multi-user.target
rclone.service
[Unit]
Description=RClone Daemon
After=multi-user.target
[Service]
Type=simple
User=0
Group=0
ExecStart=/bin/bash /home/aerya/scripts/rclone.sh
ExecStop=/bin/fusermount -uz /home/aerya/mnt/gdrive
TimeoutStopSec=20
KillMode=process
RemainAfterExit=yes
Restart=always
[Install]
WantedBy=multi-user.target
unionfs-encrypt.service
[Unit]
Description=UnionFS Daemon
Requires=plexdrive.service
After=multi-user.target plexdrive.service
[Service]
Type=simple
User=0
Group=0
ExecStartPre=/bin/sleep 10
ExecStart=/usr/bin/unionfs -o cow,allow_other,nonempty /home/aerya/mnt/move=RW:/home/aerya/mnt/encrypt=RO /home/aerya/mnt/unionfs
ExecStop=/bin/fusermount -uz /home/aerya/mnt/unionfs
TimeoutStopSec=20
KillMode=process
RemainAfterExit=yes
Restart=always
[Install]
WantedBy=multi-user.target
unionfs.service
[Unit]
Description=UnionFS Daemon
Requires=plexdrive.service
After=multi-user.target plexdrive.service
RequiresMountsFor=/home/aerya/mnt/plexdrive
[Service]
Type=simple
User=0
Group=0
ExecStartPre=/bin/sleep 10
ExecStart=/usr/bin/unionfs -o cow,allow_other,nonempty /home/aerya/mnt/move=RW:/home/aerya/mnt/plexdrive=RO /home/aerya/mnt/unionfs
ExecStop=/bin/fusermount -uz /home/aerya/mnt/unionfs
TimeoutStopSec=20
KillMode=process
RemainAfterExit=yes
Restart=always
[Install]
WantedBy=multi-user.target