Version 88 (modified by dkocher, on Feb 2, 2018 at 8:27:24 PM) (diff) |
---|
Table of Contents
Cyberduck Help / Howto / Command Line Interface (CLI)
Cyberduck with a command line interface (CLI) is available for Mac, Windows & Linux. It is installed as duck.
Installation
Mac
Homebrew
Available as a Homebrew package. Use
brew install duck
to install.
Snaphsot Builds
brew install iterate-ch/cyberduck/duck
Package
Download the latest installer package.
Windows
Chocolatey
Available as a Chocolatey package. Use
choco install duck
to install.
MSI Installer
Download the latest setup.
Linux
RPM Package Repository
To add the duck repository to your system you need to put a file duck.repo with following content into /etc/yum.repos.d/.
Snaphsot Builds
Copy and paste
echo -e "[duck-nightly]\n\ name=duck-nightly\n\ baseurl=https://repo.cyberduck.io/nightly/\$basearch/\n\ enabled=1\n\ gpgcheck=0" | sudo tee /etc/yum.repos.d/duck-snapshot.repo > /dev/null
to add the configuration.
Stable Builds
echo -e "[duck-stable]\n\ name=duck-stable\n\ baseurl=https://repo.cyberduck.io/stable/\$basearch/\n\ enabled=1\n\ gpgcheck=0" | sudo tee /etc/yum.repos.d/duck-stable.repo > /dev/null
To install Cyberduck CLI use
sudo yum install duck
DEB Package Repository
Add the duck repositories to your /etc/apt/sources.list:
deb https://s3.amazonaws.com/repo.deb.cyberduck.io nightly main deb https://s3.amazonaws.com/repo.deb.cyberduck.io stable main
You need to download the GPG public key from keyserver.ubuntu.com to verify the integrity of the packages:
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys FE7097963FEFBE72
Synchronize the repository using
sudo apt-get update
To install or upgrade Cyberduck CLI use
sudo apt-get install duck
Arch Linux Package
Manual installation
Packages can also be found for download.
Usage
Run --help to get the option screen.
Usage:duck [options...] URLs must be fully qualified. Paths can either denote a remote file (ftps://user@example.net/resource) or folder (ftps://user@example.net/directory/) with a trailing slash. You can reference files relative to your home directory with /~ (ftps://user@example.net/~/). Supported protocols Windows Azure Storage azure://<container>/<key> Backblaze B2 Cloud Storage b2://<hostname>/<folder>/<file> WebDAV (HTTP) dav://<hostname>/<folder>/<file> WebDAV (HTTPS) davs://<hostname>/<folder>/<file> Dropbox dropbox://<hostname>/<folder>/<file> mellifera file://<hostname>/<folder>/<file> FTP (File Transfer Protocol) ftp://<hostname>/<folder>/<file> FTP-SSL (Explicit AUTH TLS) ftps://<hostname>/<folder>/<file> Google Drive googledrive://<hostname>/<folder>/<file> Google Cloud Storage gs://<container>/<key> Microsoft OneDrive onedrive://<hostname>/<folder>/<file> Amazon S3 s3://<container>/<key> SFTP (SSH File Transfer Protocol) sftp://<hostname>/<folder>/<file> Rackspace Cloud Files (US) swift://<container>/<key> Swift (OpenStack Object Storage) swift://<container>/<key> You can install additional connection profiles in ~/Library/Group Containers/G69SCX94XU.duck/Library/Application Support/duck/Profiles --application <path> External editor application --chmod <<mode>> Set explicit permission from octal mode value for uploaded file --copy <url> <url> Copy between servers -D,--delete <url> Delete -d,--download <url> <[file]> Download file or folder. Denote a folder with a trailing '/' -e,--existing <action> Transfer action for existing files Options for downloads and uploads: Resume Append existing files (resume) Overwrite Overwrite all files (overwrite) Rename Rename transferred files with a timestamp appended to the filename (similar) Rename existing Rename existing files with timestamp appended to filename (rename) Skip Skip transfer of files that already exist (skip) Compare Skip files that match size, modification date or checksum (compare) Cancel (cancel) Options for synchronize: Download Download changed and missing files (download) Upload Upload changed and missing files (upload) Mirror Download and Upload (mirror) Cancel (cancel) --edit <url> Edit file in external editor -h,--help Print this help -i,--identity <private key file> Selects a file from which the identity (private key) for public key authentication is read -L,--longlist <url> Long list format with modification date and permission mask -l,--list <url> List files in remote folder --nokeychain Do not save passwords in keychain -P,--preserve Preserve permissions and modification date for transferred files -p,--password <password or secret key> Password --parallel <connections> Number of concurrent connections to use for transfers -q,--quiet Suppress progress messages -r,--retry <count> Retry failed connection attempts --region <location> Location of bucket or container --synchronize <url> <directory> Synchronize folders --throttle <bytes per second> Throttle bandwidth -u,--username <username or access key> Username --udt Use UDT protocol if applicable --upload <url> <file> Upload file or folder recursively -V,--version Show version number and quit -v,--verbose Print transcript -y,--assumeyes Assume yes for all prompts
URI
The <url> argument for --copy, --download, --upload and --synchronize must be fully qualified URIs with protocol, hostname and absolute remote path such as ftp://<hostname>/<folder>/<file> for a file or ftp://<hostname>/<folder>/ for a directory. For cloud storage providers, reference the target container (aka bucket) name in the URI like s3://bucketname/key.
Generic options
--retry
Retry requests with I/O failures once per default. Useful on connection timeout or latency issues.
--verbose
Print protocol transcript for requests and responses. This includes the HTTP headers.
Credentials
You can pass username as part of the URI prepending to the hostname with username@host. Alternatively use the --username option. You can give the password with the --password option or you will be prompted before the connection is opened by the program if no password matching the host is found in your login keychain (OS X) or user configuration shared with Cyberduck (Windows).
Private Key
When connecting with SFTP you can give a file path to a private key with --identity for use with public key authentication.
Tenant Name
When connecting with OpenStack Swift you can set the tenant name (OpenStack Identity Service, Keystone 2.0) or project (OpenStack Identity Service, Keystone 3.0) with --username <tenant>:<user>.
Downloads with --download
Glob pattern support for selecting files to transfer
You can transfer multiple files with a single command using a glob pattern for filename inclusion such as duck --download ftps://<hostname>/directory/*.css .
Uploads with --upload
Glob pattern support for selecting files to transfer
If your shell supports glob expansion you can use a wildcard pattern to select files for upload like duck --upload ftps://<hostname>/directory/ ~/*.jpg.
Use of ~
You can use the tilde to abbreviate the remote path pointing to the remote home folder as in sftp://duck.sh/~/. It will be expanded when constructing absolute paths.
Remote directory listings with --list
Use the -L option to print permission mask and modification date in addition to filename.
Edit with --edit
You can edit remote files with your preferred editor on your local system using the --edit command. Use the optional --application option to specify the absolute path to the external editor you want to use.
Multiple transfer connections with --parallel
Transfer files with multiple concurrent connections to a server.
Cryptomator
Access to your Cryptomator vaults from the command line. When accessing a vault using --download, --list or --upload, you will be prompted to provide the passphrase for the vault if not found in the keychain.
Samples
Watching changes in directory with fswatch and upload
fswatch is a file change monitor; an application to watch for file system changes. Refer to their documentation.
fswatch -0 ~/Sites/mywebsite/ | xargs -0 -I {} -t sh -c 'f="{}"; duck --upload ftps://<hostname>/sandbox`basename "${f}"` "${f}" -existing overwrite'
Upload build artifacts from continuous integration (Jenkins) to CDN
Use a post build script action.
cd ${WORKSPACE}; find build -name '*.tar' -print0 | xargs -0 -I {} -t sh -c 'f="{}"; duck --quiet --retry --existing skip --region DFW --upload rackspace://<container>/ "${f}"'
Upload files matching glob pattern to Windows Azure
duck --username kahy9boj3eix --upload azure://kahy9boj3eix.blob.core.windows.net/<containername>/ *.zip
Download files matching glob pattern from FTP
duck -v --download ftp://mirror.switch.ch/mirror/apache/dist/httpd/*.gz ~/Downloads
Download file from Amazon S3 public bucket
duck --verbose --download s3://repo.maven.cyberduck.io/releases/ch/cyberduck/s3/6.1.0/s3-6.1.0.jar ~/Downloads/
Application Support Directory
Profiles
The directory location is printed with --help following the list of supported protocols.
macOS
The support directory is ~/Library/Group Containers/G69SCX94XU.duck/Library/Application Support/duck/ on Mac. You can install third party profiles in ~/Library/Group Containers/G69SCX94XU.duck/Library/Application Support/duck/Profiles.
Windows
Install additional profiles in %AppData%\Cyberduck\Profiles on Windows.
Linux
The support directory is ~/.duck/ on Linux. You can install third party profiles in ~/.duck/profiles/.
Preferences
You can override default preferences by setting environment variables in your shell.
env "property.name=value" duck
Thirdparty References
Attachments (1)
- Cyberduck CLI Setup.png (48.6 KB) - added by dkocher on Dec 4, 2014 at 2:02:59 PM.
Download all attachments as: .zip