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. Log into the control panel.  
  2. Download our profile and install the client.
  3. In the new window, enter a nickname (optional) and tenant ID (username). 

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.

Linux

There is no Cyberduck GUI available for Linux.

Installing Cyberduck Console Clients

Windows

There are two ways to install the Cyberduck CLI for Windows.

The first option is from the Chocolatey package manager.

To install, simply run the command:

choco install duck

To update Cyberduck, run:

choco upgrade duck

The second option is from the MSI installer, which is available at https://dist.duck.sh/.

For more information, see https://trac.cyberduck.io/wiki/help/en/howto/cli#Windows.

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

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

duck -<argument> swift://<user_name>@auth.selcdn.ru/<path_to_object> -p <password>

The program will ask for the account owner’s ID (tenant). Enter a username that has cloud access. Dialog mode can be turned off using the -q option.

Retrieving a Container’s File List

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

duck -l swift://username@auth.selcdn.ru/<path to container> -p <password>

Listing directory images…
1.jpg
2.jpg
3.png

Downloading a File

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

duck -d swift://username@auth.selcdn.ru/ <path_to_file> <file_name> -p <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 swift://<user_name>@auth.selcdn.ru/<path_to_file> -p <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 swift://username@auth.selcdn.ru <full_path_to_object_in_storage> <path_to_object_on_local_machine> -p <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.

duck --upload swift://$SWIFT_USERNAME@$SWIFT_AUTHURL/$BACKUP_PATH/ $LOCAL_PATH --existing rename --password $SWIFT_PASSWORD -q

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

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 swift://username@auth.selcdn.ru <full_directory_to_object_in_storage> <path_to_file_on_local_machine> --existing compare -p <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 swift://<username@auth.selcdn.ru>/<path_to_object_in_storage> <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.

#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

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 swift:// <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.