Cyberduck File Manager

Cyberduck is a popular FTP and SFTP client for Windows, MacOS, and Linux that supports the most popular protocols, including FTP, SFTP, WebDAV, and AmazonS3. The software can also be used to manage various cloud storage services.

Installing Cyberduck GUI

Windows

We’ve created a Cyberduck profile specially for our Cloud Storage clients. This profile uses Swift instead of FTP, which improves the overall quality of work.

To load the profile:

  1. Download our profile.
  2. Install the client, copying the Selectel profile to the profiles folder (the default location for this is C:\Program Files (x86)\Cyberduck\profiles).
  3. Launch Cyberduck and click Open Connection.
  4. Choose the Selectel Cloud Storage profile. 
  5. Fill in the Selectel ID:Username field with:
    • Selectel ID (1) - this is your login to the Selectel control panel
    • Username (2) - this is your Cloud Storage user name

    Please note that the user name and password are set by the account owner and can be found in the control panel under Cloud Storage  Users.

  6. Enter your password in the Password field.
  7. Click Connect.

A connection to Cloud Storage will be established and a list of your available containers will be displayed in the new window.

You will then be prompted to enter your password.

After authenticating, a connection will be established with Cloud Storage.

MacOS

Cyberduck GUI can be installed on MacOS from the Appstore.

  1. Download our profile and choose Selectel Cloud Storage as your Cyberduck connection.
  2. Fill in the Selectel ID:Username field with:
    • Selectel ID (1) - this is your login to the Selectel control panel
    • Username (2) - this is your Cloud Storage user name
  3. Enter your password in the Password field.
  4. Click Connect.

This will open a window displaying your available containers.

Linux

There is no Cyberduck GUI available for Linux.

Installing Cyberduck Console Clients

Windows

Cyberduck CLI can be installed from the Chocolatey package manager.

Enter the command

choco install duck

Download the latest version of the MSI installer from the link (https://dist.duck.sh/). More information can be found at https://trac.cyberduck.io/wiki/help/en/howto/cli#Windows.

To install the Selectel profile, copy the profile to the profiles folder (the default location for this is C:\Program Files (x86)\Cyberduck CLI\profiles).

MacOS

Cyberduck CLI for MacOS is installed using the Homebrew package manager:

brew install duck

Linux

Here we’ll describe the installation process for Ubuntu 16.04; for other distributions, refer to the official documentation.

To install Cyberduck:

1. Add the necessary repositories:

echo 'deb https://s3.amazonaws.com/repo.deb.cyberduck.io nightly main' >/etc/apt/sources.list
echo 'deb https://s3.amazonaws.com/repo.deb.cyberduck.io stable main' >/etc/apt/sources.list 

2. Add a key:

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys FE7097963FEFBE72

3. Run the following commands:

sudo apt-get update
sudo apt-get install duck

Basic Operations

Download the Selectel profile:

wget https://support.selectel.ru/storage/static/tools/selectel-storage.cyberduckprofile

Create a profiles directory:

mkdir .duck/profiles

Move the Selectel profile to the profiles directory:

mv 'selectel-storage.cyberduckprofile' .duck/profiles/

All of the commands for working with Selectel Cloud Storage look as follows:

duck -<argument> selectel://<container name> --username <Selectel ID>:<Username> --password <password>

To view a list of all possible arguments, enter:

duck --help

Retrieving a Container’s File List

To retrieve a list of files saved in a container, use the -l option (or --list):

duck -l selectel://<container name> --username <Selectel ID>:<Username> --password <password>

The printout will look like this:

1.jpg
2.jpg
3.png

Please note that some Linux systems won't display filenames with non-Latin characters.

Downloading a File

To download a file from the cloud, we use the command:

duck -d selectel://<container name> --username <Selectel ID>:<Username> --password <password>

Opening Files to Edit on Local Machine

Using Cyberduck CLI, we can open files to edit on the local machine. When we finish editing, the updated file (with all of the changes made) will be uploaded to storage. This is done using the -edit option:

duck --edit selectel://<container name> --username <Selectel ID>:<Username> --password <password>

The file will be opened by the system’s default application for that file type, and the updated file will be uploaded automatically.

This should be useful for users who host their static sites in our storage. To quickly edit a site’s text, you just have to run the command, make the desired changes, and save.

Uploading Objects to the Cloud

Objects can be uploaded using the following command:

duck --upload selectel://<container name> --username <Selectel ID>:<Username> --password <password>

Please note that the full storage path has to be given in order to upload. For example, if we want to save the file myimage.png to the container ‘images’, then we have to enter its path as: /images/myimage.png.

Cyberduck can upload large objects (bigger than 2 GB) to the cloud in segments.

Object Versions and Backups

Cyberduck CLI is a convenient tool for making backups and archiving data. We’ll look at a few examples to better understand these functions.

Let’s say we have a directory on a local machine whose contents should periodically be copied to the cloud. A special script has been written for this and a cron task has been added, which sends backups to the cloud every day at a given time.

The script will look like this:

#!/bin/bash
SWIFT_USERNAME=username
SWIFT PASSWORD=password for accessing storage
SWIFT_AUTH_URL=auth.selcdn.ru
BACKUP_PATH=path to backup in storage
LOCAL_PATH=path to folder on local machine
 
duck --upload selectel://$SWIFT_USERNAME@$SWIFT_AUTHURL/$BACKUP_PATH/ $LOCAL_PATH --existing rename --password $SWIFT_PASSWORD -q

Look at the syntax of the duck command. In this example, the --existing key is used, which tells the program what to do with the existing files in storage. The rename option renames existing copies by adding the date and time to their name.

Using Cyberduck, we can make and compare backups. This is done using the compare option:

duck --upload  selectel://<full path to object in storage> <path to file on local machine> --existing compare --username <Selectel ID>:<Username> --password <password>

When executing this command, the program compares the uploaded copy to existing files by size, last modified date, and checksum. If the parameters are different, then the old version gets deleted and the new version is uploaded to storage.

By using the skip option, only new files (i.e. files that have been added to the local folder since the last upload) are uploaded to storage. Existing files won’t be uploaded, even if they were changed on the local machine.

Finally, the overwrite option simply deletes the existing backup from storage and uploads the new version.

Synchronizing Local Files with Storage Files

File synchronization is a process that leaves you with two directories with identical sets of the latest files: one on the local machine and one in the cloud. If any files have been changed, added, or deleted on the local machine, then these files will be changed, added to, or deleted from storage, and vice versa.

Synchronization is performed using the command:

duck --synchronize selectel://<container name> --username <Selectel ID>:<Username> --password <password> <path to folder on local machine>

Using the synchronization function, copies of data in storage can be kept up-to-date with those on the local machine.

An example of this script would be:

#bin/bash
SWIFT_USERNAME=username
SWIFT PASSWORD=password for accessing storage
SWIFT_AUTH_URL=auth.selcdn.ru
BACKUP_PATH=path to backup in storage
LOCAL_PATH=path to folder on local machine
 
duck --synchronize selectel://$SWIFT_USERNAME@SWIFT_AUTHURL/$BACKUP_PATH $LOCAL_PATH --password $SWIFT_PASSWORD -q

Just add the corresponding task to cron and data will automatically synchronize at the given interval.

This function is useful for storing static sites in the cloud. To update a site, just make the appropriate changes to files on the local machine and then run the synchronization command.

Copying Files

To copy a file from one container to another, we run the following command:

duck --сopy selectel:// <username@auth.selcdn.ru>/<full_path_to_file> <username@auth.selcdn.ru>/<path_to_new_location_in_storage> -p <password>

Option -v

To print information in the console on all the HTTP requests that occurred while performing storage operations and their responses, we use the -v (or -verbose) option. This helps us understand how third-party applications interact with storage.