Loading
go up

Rclone est maintenant configuré

Copier / synchroniser un répertoire

Sur votre machine locale, créez ou choisissez un répertoire contenant quelques fichiers (ici un répertoire Photos contenant 4 photos) puis
bruno@lea:~$ rclone -v mkdir BackupStorage:photos # Création d'un répertoire distant
2021/03/23 18:07:59 INFO  : Swift container photos: Container "photos" created
bruno@lea:~$ rclone -v copy Photos/ BackupStorage:photos # copie des photos dans le répertoire distant
2021/03/23 18:17:54 INFO  : 20181016_172625.jpg: Copied (new)
2021/03/23 18:17:55 INFO  : 20181020_111730.jpg: Copied (new)
2021/03/23 18:17:55 INFO  : 20181016_172545.jpg: Copied (new)
2021/03/23 18:17:56 INFO  : 20181020_111214.jpg: Copied (new)
2021/03/23 18:17:56 INFO  : 
Transferred:       22.712M / 22.712 MBytes, 100%, 7.313 MBytes/s, ETA 0s
Transferred:            4 / 4, 100%
Elapsed time:         4.6s

bruno@lea:~$ rclone tree BackupStorage: # affichage de BackupStorage:
/
└── photos
    ├── 20181016_172545.jpg
    ├── 20181016_172625.jpg
    ├── 20181020_111214.jpg
    └── 20181020_111730.jpg

1 directories, 4 files
bruno@lea:~$
Le répertoire local est bien copié. La commande copy peut être répétée plusieurs fois, seul les nouveaux fichiers et les fichiers modifiés seront transférés.
Les fichiers qui ont été localement supprimés sont conservés dans le container distant.

Et pour chiffrer la copie distante ?

Rclone à actuellement une destination BackupStorage non chiffrée. On ne chiffre pas la destination directement. Il faut recréer une destination dont l'objectif sera :
graph LR A[Répertoire local] --> B{Chiffrement Rlone} B --> C{Rclone swift OVH} A --> C C --> D[OVH cloud storage]
bruno@lea:~$ rclone config
Current remotes:

Name                 Type
====                 ====
BackupStorage        swift

e) Edit existing remote
n) New remote
d) Delete remote
r) Rename remote
c) Copy remote
s) Set configuration password
q) Quit config
e/n/d/r/c/s/q> n
name> EncStorage
Type of storage to configure.
10 / Encrypt/Decrypt a remote
   \ "crypt"
   Storage> 10
remote> BackupStorage:SecPhotos # Remote to encrypt/decrypt.
 1 / Encrypt the filenames see the docs for the details.
   \ "standard"
filename_encryption> 1 # How to encrypt the filenames.
 1 / Encrypt directory names.
directory_name_encryption> 1 # Option to either encrypt directory names or leave them intact.
Password or pass phrase for encryption.
y) Yes type in my own password
g) Generate random password
y/g> g
Password strength in bits.
Bits> 256
Your password is: vhqdp1ULsJ8kwmsKyYQU3eugW7xb_cvj8ke799VBQqA
Use this password?
y/n> y  
Password or pass phrase for salt. Optional but recommended.
g) Generate random password
y/g/n> g
Bits> 256
Your password is: abFip_9QnOYZcinGxmW52F3zMUNsv1qtbpALW8n7xd8
Use this password?
y/n> y
Edit advanced config? (y/n)
y/n> n
Remote config
--------------------
[EncStorage]
remote = BackupStorage:SecPhotos
filename_encryption = standard
directory_name_encryption = true
password = *** ENCRYPTED ***
password2 = *** ENCRYPTED ***
--------------------
y) Yes this is OK (default)
e) Edit this remote
d) Delete this remote
y/e/d> y
Current remotes:

Name                 Type
====                 ====
BackupStorage        swift
EncStorage           crypt

e) Edit existing remote
n) New remote
d) Delete remote
r) Rename remote
c) Copy remote
s) Set configuration password
q) Quit config
e/n/d/r/c/s/q> q
bruno@lea:~$ rclone -v copy Photos/ EncStorage:EncPhotos/
2021/04/03 17:29:36 INFO  : Swift container SecPhotos path 80cp8ogb5e3n1oh5isudpmc6v0: Container "SecPhotos" created
2021/04/03 17:29:38 INFO  : 20181020_111730.jpg: Copied (new)
2021/04/03 17:29:38 INFO  : 20181020_111214.jpg: Copied (new)
2021/04/03 17:29:38 INFO  : 20181016_172545.jpg: Copied (new)
2021/04/03 17:29:39 INFO  : 20181016_172625.jpg: Copied (new)
2021/04/03 17:29:39 INFO  : 
Transferred:       22.718M / 22.718 MBytes, 100%, 6.380 MBytes/s, ETA 0s
Transferred:            4 / 4, 100%
Elapsed time:         6.1s

bruno@lea:~$ rclone tree BackupStorage:
/
├── SecPhotos
│   └── 80cp8ogb5e3n1oh5isudpmc6v0
│       ├── gobuadcmo7fdd26rtojg8p9fk79g6dmf6tpnpcktd37fnjvgmipg
│       ├── hepiv7kbt4oght5g02imo39rhu6l49ni21f8cbu5sr829m9ohfv0
│       ├── hg967j11d5jo22gtir4c7ftfm08e5fa9pb7or1pp6m6pi75msajg
│       └── qg5161k7lukaqvo273mcoh47cujesv68tvct6uri3fn665gcj0ag
└── photos
    ├── 20181016_172545.jpg
    ├── 20181016_172625.jpg
    ├── 20181020_111214.jpg
    └── 20181020_111730.jpg

3 directories, 8 files
bruno@lea:~$ rclone tree EncStorage:
/
└── EncPhotos
    ├── 20181016_172545.jpg
    ├── 20181016_172625.jpg
    ├── 20181020_111214.jpg
    └── 20181020_111730.jpg

1 directories, 4 files
bruno@lea:~$ rclone -v sync Photos/ EncStorage:EncPhotos/
2021/04/03 17:39:25 INFO  : There was nothing to transfer
2021/04/03 17:39:25 INFO  : 
Transferred:             0 / 0 Bytes, -, 0 Bytes/s, ETA -
Checks:                 4 / 4, 100%
Elapsed time:         0.7s

bruno@lea:~$