admin avatar

Tutorial to sync files to backblaze using rclone

🕞 by admin

rclone is an open source golang-based file synchronization tool with the following main features:

Always check MD5 / SHA1 hash for file integrity Preserved timestamp on file Supports partial synchronization based on the entire file Copy mode only copies new / changed files Synchronous (unidirectional) mode to make directories the same Check mode to check if file hashes are equal Can sync with the network, for example with two different cloud accounts Cryptographic backend Cache backend Block backend Federated backend Optional FUSE mount (rclone mount) Multi-threaded download to local disk Can provide local or remote files via HTTP / WebDav / FTP / SFTP / dlna GUI based on experimental web Many supported cloud storage platforms, such as OVH, onedrive, google drive, etc . .

backblaze introduction, from Wikipedia

Backblaze is a data storage provider. It offers two products: B2 Cloud Storage-Object storage service similar to Amazon S3. Computer Backup-An online backup tool that allows Windows and macOS users to back up their data to offsite data centers. Designed for businesses and end users, the service offers unlimited storage and supports unlimited file sizes.

The main feature is that backblaze individual users have 10GB of free storage capacity, but have read and write APIs etc. now. . .

Each user has 1GB of free traffic per day and 2,500 files are read and written simultaneously. . . .

backblaze official website

https://www.backblaze.com/en_US/

rclone installation

curl https://rclone.org/install.sh | sudo bash

More system installation reference official website document

https://rclone.org/install/

The following configures rclone to sync files to backblaze

Register the backblaze application key, see the picture below

Add a new application key, remember that the key is only shown once

Configure rclone

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
rclone config
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> testb2
Choice 5
1/1 Fichier
   \ "fichier"
 2 / Alias ​​for an existing remote
   \ "alias"
 3 / Amazon Drive
   \ "amazon cloud drive"
 4 / Amazon S3 Compliant Storage Provider (AWS, Alibaba, Ceph, Digital Ocean, Dreamhost, IBM COS, Minio, etc)
   \ "s3"
 5 / Backblaze B2
   \ "b2"
 6 / Box
   \ "box"
 7 / Cache a remote
   \ "cache"
 8 / Citrix Sharefile
   \ "sharefile"
 9 / Dropbox
   \ "dropbox"
10 / Encrypt / Decrypt a remote
   \ "crypt"
11 / FTP Connection
   \ "ftp"
12 / Google Cloud Storage (this is not Google Drive)
   \ "google cloud storage"
13 / Google Drive
   \ "drive"
14 / Google Photos
   \ "google photos"
15 / Hubic
   \ "hubic"
16 / In memory object storage system.
   \ "memory"
17 / JottaCloud
   \ "jottacloud"
18 / Koofr
   \ "koofr"
19 / Local Disk
   \ "local"
20 / Mail.ru Cloud
   \ "mailru"
21 / Mega
   \ "mega"
22 / Microsoft Azure Blob Storage
   \ "azureblob"
23 / Microsoft OneDrive
   \ "onedrive"
24 / OpenDrive
   \ "opendrive"
25 / Openstack Swift (Rackspace Cloud Files, Memset Memstore, OVH)
   \ "swift"
26 / Pcloud
   \ "pcloud"
27 / Put.io
   \ "putio"
28 / QingCloud Object Storage
   \ "qingstor"
29 / SSH / SFTP Connection
   \ "sftp"
30 / Sugarsync
   \ "sugarsync"
31 / Transparently chunk / split large files
   \ "chunker"
32 / Union merges the contents of several remotes
   \ "union"
33 / Webdav
   \ "webdav"
34 / Yandex Disk
   \ "yandex"
35 / http Connection
   \ "http"
36 / premiumize.me
   \ "premiumizeme"

Enter the key ID shown above, then enter the key again

Look at the following code, modify the relevant key and id by yourself

Account ID or Application Key ID
Enter a string value. Press Enter for the default ("").
account> 93ofsdljfksljfkdsfkdsf
Application Key
Enter a string value. Press Enter for the default ("").
key> j39re0wr9reiw8s9pdfsjdlkfjsd
Permanently delete files on remote removal, otherwise hide files.
Enter a boolean value (true or false). Press Enter for the default ("false").
hard_delete>
Edit advanced config? (Y / n)
y) Yes
n) No (default)
y / n> n
Remote config
--------------------
[testb2]
type = b2
account = 93ofsdljfksljfkdsfkdsf
key = j39re0wr9reiw8s9pdfsjdlkfjsd
--------------------
y) Yes this is OK (default)
e) Edit this remote
d) Delete this remote
y / e / d> y

Test if the configuration is successful

rclone ls tetb2:filename

rclone sync -v /var/www/test/ tetb2:filename/

Synchronize all files in the local /var/www/test/ folder to the backblaze storage filename directory

And the -V parameter is used to indicate the synchronization progress. . .

In fact, the sync command is equivalent to an incremental update, which means that if there are no source files, all redundant files on the remote storage will be deleted.

The second time you execute the sycn command, only the modified files are synchronized.

Other files are skipped ~~~~ so you don't worry about traffic and backblaze daily API restrictions

The filename folder here must be created by itself in backblaze, otherwise an error will be reported

💘 相关文章

写一条评论