Passa al contenuto principale

Rclone

Intro

Rclone è uno strumento a riga di comando per la gestione dei file su cloud storage, che offre un'alternativa alle interfacce di web storage. Supporta oltre 40 prodotti di cloud storage, tra cui gli object storage S3 e vari servizi di archiviazione di file e fornisce gli equivalenti cloud dei più diffusi comandi Unix. Offre il supporto per le pipeline di shell, la protezione --dry-run e può essere utilizzato alla riga di comando, in script o tramite la sua API.

Segui le istruzioni dei prossimi paragrafi per imparare a configurare Rclone ed eseguire un backup sul tuo account Cubbit.

tip

Questa guida si riferisce alla versione v1.64.2 di Rclone.

Le opzioni di rclone elencate di seguito possono variare a seconda della versione utilizzata.

Prerequisiti

Per prima cosa, è necessario ottenere access key e secret key dalla Cubbit Web Console oppure https://console.[il-tuo-tenant].cubbit.eu. Si possono seguire queste istruzioni su come iniziare con un account Cubbit e generare queste chiavi.

Installazione

Esistono diversi modi per installare Rclone. Segui le istruzioni direttamente sul sito ufficiale.

Configurazione

caution

Le seguenti istruzioni dovrebbero funzionare su qualsiasi macchina UNIX in grado di eseguire Rclone.

Per qualsiasi dubbio, è possibile consultare la guida ufficiale alla configurazione.

Una volta installato, dovresti essere in grado di eseguire il comando per aggiungere una configurazione.

rclone config

Verrà avviata una sessione interattiva per guidarti attraverso il processo di configurazione di un remote.

Premi n per creare un nuovo remote:

No remotes found, make a new one?
n) New remote
s) Set configuration password
q) Quit config
n/s/q> n

Enter name for new remote.
name> cubbit

Quindi è necessario scegliere a quale memoria si connetterà il remote.

Poiché Cubbit utilizza il protocollo S3, premi 5 per selezionare l'opzione di archiviazione generica S3. Quindi, selezionare la riga "Qualsiasi altro provider compatibile con S3".

Option Storage.
Type of storage to configure.
Choose a number from below, or type in your own value.
1 / 1Fichier
\ (fichier)
2 / Akamai NetStorage
\ (netstorage)
storage> 5

Quindi, configura il metodo di autenticazione. Premi 1 per salvare le credenziali con la configurazione.

Option env_auth.
Get AWS credentials from runtime (environment variables or EC2/ECS meta data if no env vars).
Only applies if access_key_id and secret_access_key is blank.
Choose a number from below, or type in your own boolean value (true or false).
Press Enter for the default (false).
1 / Enter AWS credentials in the next step.
\ (false)
2 / Get AWS credentials from the environment (env vars or IAM).
\ (true)
env_auth> 1

Inserisci qui l'access key.

Option access_key_id.
AWS Access Key ID.
Leave blank for anonymous access or runtime credentials.
Enter a value. Press Enter to leave empty.
access_key_id> ******************

e qui la secret key.

Option secret_access_key.
AWS Secret Access Key (password).
Leave blank for anonymous access or runtime credentials.
Enter a value. Press Enter to leave empty.
secret_access_key> ******************

Aggiungere la regione eu-west-1, premi enter.

Option region.
Region to connect to.
Choose a number from below, or type in your own value.
Press Enter to leave empty.
/ Use this if unsure.
1 | Will use v4 signatures and an empty region.
\ ()
/ Use this only if v4 signatures don't work.
2 | E.g. pre Jewel/v10 CEPH.
\ (other-v2-signature)
region> eu-west-1

Configura l'endpoint di Cubbit.

tip

Ricorda di sostituire l'endpoint https://s3.cubbit.eu con https://s3.[il-tuo-tenant].cubbit.eu se hai un tenant personalizzato.

Option endpoint.
Endpoint for S3 API.
Required when using an S3 clone.
Enter a value. Press Enter to leave empty.
endpoint> https://s3.cubbit.eu

Non impostare il location_constraint, premi Invio.

Option location_constraint.
Location constraint - must be set to match the Region.
Leave blank if not sure. Used when creating buckets only.
Enter a value. Press Enter to leave empty.
location_constraint>

Quindi è possibile configurare le ACL predefinite. Scegliamo 1.

Option acl.
Canned ACL used when creating buckets and storing or copying objects.
This ACL is used for creating objects and if bucket_acl isn't set, for creating buckets too.
For more info visit https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl
Note that this ACL is applied when server-side copying objects as S3
doesn't copy the ACL from the source but rather writes a fresh one.
If the acl is an empty string then no X-Amz-Acl: header is added and
the default (private) will be used.
Choose a number from below, or type in your own value.
Press Enter to leave empty.
/ Owner gets FULL_CONTROL.
1 | No one else has access rights (default).
\ (private)
acl> 1

A meno che tu non voglia vedere la configurazione avanzata, premi n.

Edit advanced config?
y) Yes
n) No (default)
y/n> n

... y, e abbiamo finito!

Configuration complete.
Options:
- type: s3
- provider: Other
- access_key_id: <access_key_id>
- secret_access_key: <secret_access_key>
- endpoint: https://s3.cubbit.eu
- acl: private
Keep this "cubbit" remote?
y) Yes this is OK (default)
e) Edit this remote
d) Delete this remote
y/e/d> y

Utilizzo

La seguente operazione presuppone che tu abbia già creato un bucket chiamato bucket-name sul tuo account.

List dei file

rclone ls cubbit:bucket-name

Sincronizzare le cartelle

rclone sync -P ./backup-folder cubbit:bucket-name

Eliminare un bucket con o senza S3 Versioning e il suo contenuto

rclone purge -P -vvv cubbit:bucket-name

Per maggiori informazioni sull'utilizzo di Rclone potete consultare la documentazione ufficiale.