1000 FAQs, 500 tutorials and explanatory videos. Here, there are only solutions!
Backup data via command line on Swiss Backup (CLI S3)
This guide details how to manually back up data via the command line (CLI) using the S3 Compatible protocol on Swiss Backup, an independent Swiss cloud backup solution.
Prerequisites
- Have a Infomaniak Swiss Backup space with at least one available device quota for a Cloud backup.
- Add 1 Cloud device to get the S3 Compatible parameters.
- Use a Terminal type application (command line interface, CLI / Command Line Interface) on your device
β οΈ All the services offered by Infomaniak are compatible with the corresponding standard protocols (notably IMAP/SMTP for email, WebDAV for sharing, S3/Swift for storage, etc.). Therefore, if you encounter a problem with third-party software, contact its publisher directly or a Partner and consult the support policy as well as article 11.9 of the Infomaniak Terms and Conditions.
Using an S3 location in CLI
With a Terminal application (command line interface, CLI) on your device:
Install
s3cmd
, for example on Debian/Ubuntu:sudo apt install s3cmd
or on macOS (with Homebrew):
brew install s3cmd
And 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.AccessKey
andSecretKey
= 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 region
S3 Endpoint
: use the URL provided by InfomaniakUse HTTPS
: yesHTTP Proxy server
: leave empty unless specifically configuredSignature version
: force the use of v4Path style
: choose Yes if prompted- Test access : you can perform the test to validate the configuration
(1) The indication "//s3.swiss-backup02
", "//s3.swiss-backup03
" etc. changes depending on the cluster number indicated on 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), you may encounter an error when attempting to connect or transfer data to an S3 location of 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.
Unfortunately, Infomaniak has no way to address this incompatibility, as it is related to the internal workings of the AWS CLI client, developed by Amazon.
To continue using Swiss Backup effectively via the command line, Infomaniak recommends using the open-source tool s3cmd
described earlier in this guide, which is fully compatible with S3 locations.