-
Notifications
You must be signed in to change notification settings - Fork 0
Home
cync attempts to provide a one-stop solution for users to deal with their cloud data.
cync has two operational modes.
- A default mode which provides efficient storage (compression) and more security (encryption)
- A plain mode - cync acts as a command line tool to perform remote file operations
Originally cync was operating only in the default mode. Slowly however users realized that it's nice to be able to perform cloud storage operations from the command line. Hence, the plain mode was born.
To operate in this mode, cync requires a key. This key is used to encrypt all files stored in the repository. This security is on top of the account security. In other words, even if a malicious third party gains access to the account, they are unlikely to be able to access the file content in the cync repository. What's more important is that if the user looses this key, there is no way to recover the repository files.
For convenience, sync provides a mechanism to generate a new key:
cync keygen > cync-key.txt
The key is printed in base64 format and can be stored to a file to be consumed later by cync. By default a 256 bit key is generated. Longer keys are of no use, because the currently supported encryption methods all use 256 bit keys.
Once the key is created, it's time to initialize a repository:
cync init --google-drive /onefolder --key-file cync-key.txt
The --google-drive option not only provides the root folder (on Google Drive) for the repository, but also instructs cync to operate in the default mode. To simply list the content of a Google Drive folder:
cync list --plain-google-drive /
This will produce a listing of the root Google Drive folder.
The storage types supported by cync are:
- Google Drive: --google-drive
- Plain Google Drive: --plain-google-drive
- OneDrive: --onedrive
- Plain OneDrive: --plain-onedrive
- Sftp: --sftp
- Local storage: --local
There is no plain mode for local folders and for sftp - there is plenty of utilities for that already.
In all examples, the --key-file option is used only to initialize the repository. A natural question is how the heck commands like list work without a key? The truth is that all commands require the repository definition and the key file. The reason they work without this information is because cync remembers the repository information and the key location into a user controlled folder. The folder is called .cync and resides under the user's home folder.
On Windows, the .cync folder is usually something like /Users/<User>/Documents/.cync.
On Unix the folder is ~/.cync.
Using cync has advantages even in plain mode. Sometimes a download (a pull) may fail midway. For instance, a temporary network glitch. Re-running the same cync command is going to pretty much pick up the download from the same location. Everything already downloaded is processed quickly because there is no need to synchronize it.
Using cync in the plain mode is pretty straightforward. To copy a remote folder locally:
cync pull --plain-onedrive /taxes/taxes2013 .
To upload a local folder to the cloud:
cync push --plain-onedrive taxes/taxes2013 /
To list the content of a remote folder:
cync list --plain-onedrive /