Linux Terminal Sync Client

luckycloud client for server without graphical user interface

Installation

  • Open terminal
sudo apt update && sudo apt install wget -y && sudo wget https://clients.luckycloud.de/sync-client/linux/install_luckycloud_sync_client.sh && sudo bash install_luckycloud_sync_client.sh && sudo rm install_luckycloud_sync_client.sh
  • Installation of the client without graphical user interface
sudo apt install lcs-cli

Basic Usage

Initialize & start the client

# choose a folder where to store the luckycloud client settings e.g ~/luckycloud-client
mkdir ~/luckycloud-client            # create the settings folder
lcs-cli init -d ~/luckycloud-client  # initialise luckycloud client with this folder
lcs-cli start

Download and sync a directory from a server.

  • retrieve the directory id by browsing into a directory on the server, the ID is part of the URL.
  • The format looks like f4962ce9-ba07-47b8-a83a-73dd96c2ebfd.
lcs-cli download -l "the id of the directory" -s "https://storage.luckycloud.de + port of server" -d "the folder where the directory folder will be downloaded" -u "username on server" [-p "password"]
lcs-cli status  # check status of ongoing downloads
# Name  Status  Progress
# Apps    downloading     9984/10367, 9216.1KB/s

Note: if you don't supply the password parameter in the command, it will be asked later, which is more secure.

Example:

lcs-cli download -l 0536c006-8a43-449e-8718-39f12111620d -s https://storage.luckycloud.de -d /tmp -u 

The above command will create a new folder with the same name as the directory under the specified folder.

You can also sync a directory with an existing folder on the local computer. The existing files in the local folder will be merged with the files in the directory.

lcs-cli sync -l "the id of the directory" -s "https://storage.luckycloud.de + port of server" -d "the folder which the directory will be synced with" -u "username on server" [-p "password"]

After running the download or sync command, the local folder will be automatically synced with the directory.

Detailed documentation

lcs-cli is the command line interface for luckycloud client.

Subcommands:

  • init Initialize config directory
  • start Start ccnet and luckycloud daemon
  • stop Stop ccnet and luckycloud daemon
  • list List local directories
  • list-remote List remote directories
  • status Show syncing status
  • download Download and sync a directory from luckycloud server
  • download-by-name Download and sync a directory defined by name from luckycloud server
  • sync Sync a directory with an existing folder
  • desync De-sync a directory with luckycloud server
  • create Create a directory
  • config Configure luckycloud client

Running lcs-cli -h will show the above help. For each subcommand, you can also use -h option to get help, e.g. lcs-cli download -h.

luckycloud client stores all its configure information in a config dir. The default location is ~/.ccnet. All the commands below accept an option -c .

init

Initialize luckycloud client. This command initializes the config dir. It also creates sub-directories luckycloud-data and luckycloud under parent-dir. luckycloud-data is used to store internal data, while luckycloud is used as the default location put downloaded directories.

lcs-cli init [-c <config-dir>] -d <parent-dir>

A file named luckycloud.ini will be created under ~/.ccnet to record the location of luckycloud-data directory.

If you want to run multiple instances of luckycloud cli client in the same machine, you can specify different config-dir and parent-dir when initializing different client instances. Then the instances can run without interfering each others. When starting the instances, just specify ccnet config directories with the -c option.

start

Start luckycloud client. This command starts lcs-daemon, which is the file syncing engine for luckycloud client.

lcs-cli start [-c <config-dir>]

stop

Stop luckycloud client.

lcs-cli stop [-c <config-dir>]

Download/Download-by-name

Download and sync a directory from luckycloud server. It will create a new folder with the same name as the directory under the parent folder. The download-by-name command works similarly, but can save you from finding the directory ID. It only works when the directory name is unique on the server.

lcs-cli download -l <directory-id> -s <luckycloud-server-url> -d <parent-directory> -u <username> [-p <password>]

sync

Synchronize a directory with an existing folder. The existing files in the local folder will be merged with the files in the directory.

lcs-cli sync -l <directory-id> -s <luckycloud-server-url> -d <existing-folder> -u <username> [-p <password>]

desync

Desynchronize a directory from luckycloud server. After running this command, the local folder will no longer be synced with the server.

lcs-cli desync -d <existing-folder>

create

Create a new directory on server

lcs-cli create [-h] -n directory-name -t description [-e directory-password] -s server -u username -p password

list

List information about synced directories. The information includes directory name, directory ID and local folder path for the directory.

lcs-cli list [-c <config-dir>] [--json]

list-remote

List information about accessible directories on the server. The information includes directory names and ID.

lcs-cli list-remote -s <luckycloud-server-url> -u <username> [-p <password>] [-c <config-dir>] [--json]

status

List syncing status of directories. This will return the name, syncing status and progress information about all local directories.

lcs-cli status
status meaning
synchronized Local folder is consistent with the remote directory
committing Files in local folder are being indexed
initializing Getting sync information from server
downloading file list Downloading file list from server. Progress will be displayed.
downloading files Downloading files from server. Progress will be displayed.
uploading Uploading files to server. Progress will be displayed.
error Error message will be displayed in the progress column.

Skip SSL certificate verify

If you're using self-signed certificate on the server, you should ask the client to skip verifying certificate.

lcs-cli config -k disable_verify_certificate -v true

Set Transfer Speed Limit

Set upload speed limit to 1MB/s :

lcs-cli config -k upload_limit -v 1000000

Set download speed limit to 1MB/s :

lcs-cli config -k download_limit -v 1000000

Two factor authentication

lcs-cli supports 'Two Factor Authentication'.

If you want to use the feature, you should add the argument --tfa to any lcs-cli commands. is Google Authenticator's verification code.

For example:

lcs-cli download -l "4b11d9d4-e3b1-4394-be85-9d4a80f626fa" -s "https://storage.luckycloud.de" -d "testst" -u "abc@abc.com" -p "abc" --tfa 002755

Authenticate with Tokens

If your server uses SSO (Single Sign-On) for login, you cannot use password to login from CLI. To enable using CLI in such cases, we provide an option to authenticate with an API token since luckycloud client version 8.0.4. You should be able to get your API token from profile page in the web interface. (You should run 8.0.6 server) Use "-T token" option instead of "-p password" to authenticate in the following commands:

lcs-cli create
lcs-cli download
lcs-cli sync
lcs-cli list-remote