From b381aaa3710a1c5458b3d49c84121db267582d05 Mon Sep 17 00:00:00 2001 From: gilbertchen Date: Fri, 10 Nov 2017 11:24:22 -0500 Subject: [PATCH] Created init (markdown) --- init.md | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 init.md diff --git a/init.md b/init.md new file mode 100644 index 0000000..3125456 --- /dev/null +++ b/init.md @@ -0,0 +1,33 @@ +``` +SYNOPSIS: + duplicacy init - Initialize the storage if necessary and the current directory as the repository + +USAGE: + duplicacy init [command options] + +OPTIONS: + -encrypt, -e encrypt the storage with a password + -chunk-size, -c the average size of chunks (default is 4M) + -max-chunk-size, -max the maximum size of chunks (default is chunk-size*4) + -min-chunk-size, -min the minimum size of chunks (default is chunk-size/4) + -iterations the number of iterations used in storage key deriviation (default is 16384) + -pref-dir alternate location for the .duplicacy directory (absolute or relative to current directory) +``` + +The *init* command first connects to the storage specified by the storage URL. If the storage has been already been initialized before, it will download the storage configuration (stored in the file named *config*) and ignore the options provided in the command line. Otherwise, it will create the configuration file from the options and upload the file. + +The initialized storage will then become the default storage for other commands if the `-storage` option is not specified for those commands. This default storage actually has a name, *default*. + +After that, it will prepare the current working directory as the repository to be backed up. Under the hood, it will create a directory named *.duplicacy* in the repository and put a file named *preferences* that stores the snapshot id and encryption and storage options. + +The snapshot id is an id used to distinguish different repositories connected to the same storage. Each repository must have a unique snapshot id. A snapshot id must contain only characters valid in Linux and Windows paths (alphabet, digits, underscore, dash, etc), but cannot include `/`, `\`, or `@`. + +The `-e` option controls whether or not encryption will be enabled for the storage. If encryption is enabled, you will be prompted to enter a storage password. + +The three chunk size parameters are passed to the variable-size chunking algorithm. Their values are important to the overall performance, especially for cloud storages. If the chunk size is too small, a lot of overhead will be in sending requests and receiving responses. If the chunk size is too large, the effect of de-duplication will be less obvious as more data will need to be transferred with each chunk. + +The `-iterations` option speicifies how many iterations are used to generate the key that encrypts the `config` file from the storage password. + +The `-pref-dir` option controls the location of the preferences directory. If not specified, a directory named .duplicacy is created in the repository. If specified, it must point to a non-existing directory. The directory is created and a .duplicacy file is created in the repository. The .duplicacy file contains the absolute path name to the preferences directory. + +Once a storage has been initialized with these parameters, these parameters cannot be modified any more. \ No newline at end of file