1000 FAQs, 500 tutorials and explanatory videos. Here, there are only solutions!
Save data online via command line on Swiss Backup (S3 CLI)
This guide details how to manually save data via the command line (CLI) using the S3 Compatible protocol on Swiss Backup, the backup solution in an independent Swiss cloud.
Preamble
- The various services offered by Infomaniak are all compatible with the corresponding standard protocols (S3/Swift for storage, for example), therefore if you encounter a problem with third-party software, contact its publisher or a Partner and consult the support policy as well as section 11.9 of the Infomaniak Terms of Service.
Using an S3 location in CLI
Prerequisites
- Have a Swiss Backup space from Infomaniak with available device quota (minimum 1) for a Cloud backup.
- Add 1 Cloud device to obtain the S3 Compatible parameters.
- Use a
Terminaltype application (command line interface,CLI / Command Line Interface) on your device
With a Terminal type application (command line interface, CLI / Command Line Interface) on your device:
Install
s3cmd, for example on Debian/Ubuntu:sudo apt install s3cmdor on macOS (with Homebrew):
brew install s3cmdand for Windows, it is recommended to use S3Express, an open-source command-line tool (need help?).
Enter the following command to configure the connection:
s3cmd --configure- Fill in the fields according to the information specific to your device (refer to this other guide):
Display name= choose a name for the storage.AccessKeyandSecretKey= the access keys generated from the email received from Infomaniak following the creation of the storage space.Service point= for example https://s3.swiss-backup02.infomaniak.com (1)Bucket name= defaultDefault regionS3 Endpoint: use the URL provided by InfomaniakUse HTTPS: yesHTTP Proxy server: leave blank unless specific configurationSignature version: force the use of v4Path style: choose Yes if requested- Test access: you can perform the test to validate the configuration
(1) The indication "//s3.swiss-backup02", "//s3.swiss-backup03" etc. changes according to the cluster number indicated in the Manager in the Cloud storage information under "Location"; and if your Swiss Backup device was created before October 2020, you will need to use https://swiss-backup.infomaniak.com/identity/v3
Once completed, a configuration file will be saved (by default in ~/.s3cfg).
Start a copy to Swiss Backup
Here are some basic commands to interact with Swiss Backup:
- List buckets:
s3cmd ls - List the contents of a bucket:
s3cmd ls s3://bucket-name - Send a file:
s3cmd put example.txt s3://bucket-name/ - Download a file:
s3cmd get s3://bucket-name/example.txt - Synchronize a local directory to a bucket:
s3cmd sync /path/local/ s3://bucket-name/
In case of error
Following an update to the AWS CLI (Amazon Web Services Command Line Interface) tool, you may encounter an error when attempting to connect or transfer data to an S3 location in Swiss Backup:
Transferring payloads in multiple chunks using aws-chunked is not supported
This error is related to a transfer method used by AWS CLI (aws-chunked), which is not compatible with the Swiss Backup service.
Infomaniak unfortunately has no way to address this incompatibility, as it is related to the internal operation of the AWS CLI client, developed by Amazon.
To continue using Swiss Backup via the command line effectively, Infomaniak recommends using the open-source tool s3cmd described earlier in this guide, which is fully compatible with S3 locations.