C14 is a reliable, secure and affordable data archiving & long-term backup solution starting at €0.002 per GB / month!
Today, we are excited to introduce the C14 CLI (Command Line Interface) to help you manage your C14 archives with ease. The command line interface is a powerful tool, it allows you to manage your archives faster and directly from the command line. The CLI is pretty simple and powerful: log in, create archives, upload files, freeze archives and much more directly from your shell!
To run the C14 CLI, you need to have
go. You can get it from the official Golang website.
To install the C14 CLI, simply run:
$ go get -u github.com/online-net/c14-cli/cmd/c14
Configure the CLI to use the C14 application (oauth2). Use your C14 login to generate new credentials.
$ c14 login Please opens this link with your browser: https://console.online.net/oauth/v2/device/usercode Then copy paste the code XXXXX
The C14 CLI commands are made to be simple and easy to use. As a showcase we will:
- Create an archive
- Upload data
- Permanently store the archive on C14
- Recover our archive from C14
- Download our archive content.
Step 1 - Create an archive
First, we need to create an archive to upload our files. By default, the command
c14 create will create an archive with a random name and use the standard service level.
$ c14 create 83b93179-32e0-11e6-be10-10604b9b0ad9
Step 2- Check the archive status
Let's verify our archive has been correctly created using the
ls command to get our archives name, status and UUID.
$ c14 ls NAME STATUS UUID archives01 active c031eaad-69e1-11e6-be10-10604b9b0ad9
Step 3 - Upload your data
We can now upload some data into the archive we created previously.
c14 uses the SFTP protocol to perform this operation.
$ c14 upload /tmp/files archives01 tmp/files/file2 [==================================================>] 32.77 kB/32.77 kB tmp/files/file3 [==================================================>] 32.77 kB/32.77 kB tmp/files/file4 [==================================================>] 32.77 kB/32.77 kB tmp/files/file5 [==================================================>] 65.54 kB/65.54 kB
Step 3 - Verify our archive contents
We can list and verify that our data have been properly uploaded with the
files command. The
files command display the name and size of each file present in the archive.
$ c14 files archives01 NAME SIZE tmp/ tmp/files/ tmp/files/file2 33 kB tmp/files/file3 33 kB tmp/files/file4 33 kB tmp/files/file5 66 kB
Step 4 - Permanently store our archive on C14.
We are now ready to permanently store our archive on C14.
$ c14 freeze archives01 c031eaad-69e1-11e6-be10-10604b9b0ad9[=================================>] 100.00%
Step 5 - Recover your archive
At any time, we can recover our archive using the
unfreeze command. The command will recover our archive with all file metadata (ownership, permissions, etc.).
$ c14 unfreeze c031eaad-69e1-11e6-be10-10604b9b0ad9 c031eaad-69e1-11e6-be10-10604b9b0ad9[==============================> ] 98.00%
Et voilà! We can now download our archive content.
This post is a quick introduction to the C14 CLI. If you want to discover in depth the CLI, the source code and documentation is available on GitHub.
Comments, feature requests and contributions are always welcome!
Happy data archiving!