diff --git a/README.md b/README.md index cf5429c..2194adb 100644 --- a/README.md +++ b/README.md @@ -252,25 +252,31 @@ exit without further processing. - If a file has already been uploaded, the process will exit without further processing. To overwrite existing files, use the `-force-overwrite` flag. -### Resume a multiple file upload +### Resume a multiple-file upload -It is possible to resume an interrupted upload from the last not uploaded file by adding the `-continue` flag which will prevent the `sda-cli` to return an error if a file is already uploaded on the target directory. For example: +Suppose you run the following command to upload two encrypted files, + +```bash +./sda-cli -config upload +``` + +After has been uploaded, the process is interrupted while uploading . To resume the upload, simply add the `-continue` flag to the command, as shown below: ```bash ./sda-cli -config upload -continue ``` -will skip `` because it is already uploaded on the target directory and continue uploading ``. Whereas: +The `-continue` flag is especially useful when recursively uploading an entire folder with encrypted files. For example, the following command: ```bash -./sda-cli -config upload -r -continue +./sda-cli -config upload -r -continue ``` -will skip uploading any files that are already uploaded to the target location and proceed with uploading the remaining files of ``, effectively resuming the upload of the later in case this was previously interrupted. +will skip uploading any files that are already uploaded to the target location and proceed with uploading the remaining files of ``, effectively resuming the upload of the later in case this was previously interrupted. Notes: -- `-continue` can be combined with any of the available flags except from `-force-overwrite`. In this scenario, the latter has precedence. +- `-continue` can be combined with any of the available flags except `-force-overwrite`. In this case, the latter takes precedence. - `-continue` will not resume partially uploaded files. Any such file will be re-uploaded. ## List diff --git a/upload/upload.go b/upload/upload.go index 0dc8752..63eec59 100644 --- a/upload/upload.go +++ b/upload/upload.go @@ -42,7 +42,7 @@ Options: if already set in the config file or as the 'ACCESSTOKEN' environment variable. -continue Skip already uploaded files and continue with uploading the rest. - Useful for resuming an upload from the previous breakpoint. + Useful for resuming an upload from a previous breakpoint. -encrypt-with-key Encrypt files using the specified public key before upload. The key file may contain multiple concatenated public keys. @@ -166,7 +166,7 @@ func uploadFiles(files, outFiles []string, targetDir string, config *helpers.Con fileExists := len(listResult.Contents) > 0 && aws.StringValue(listResult.Contents[0].Key) == filepath.Clean(config.AccessKey+"/"+listPrefix) switch { case fileExists && *continueUpload: - fmt.Printf("File %s is already uploaded, continuing with next file...\n", filepath.Base(filename)) + fmt.Printf("File %s has already been uploaded, continuing with the next file...\n", filepath.Base(filename)) continue case fileExists && !*continueUpload: