diff --git a/cmd/copy/copy.go b/cmd/copy/copy.go index 4ace3e9d8..0cf93e264 100644 --- a/cmd/copy/copy.go +++ b/cmd/copy/copy.go @@ -98,39 +98,38 @@ for more info. ## Logger Flags -The ` + "`--differ`" + `, ` + "`--missing-on-dst`" + `, ` + "`--missing-on-src`" + `, ` + - "`--match`" + ` and ` + "`--error`" + ` flags write paths, one per line, to the file name (or -stdout if it is ` + "`-`" + `) supplied. What they write is described in the -help below. For example ` + "`--differ`" + ` will write all paths which are -present on both the source and destination but different. +The |--differ|, |--missing-on-dst|, |--missing-on-src|, |--match| and |--error| flags write paths, +one per line, to the file name (or stdout if it is |-|) supplied. What they write is described +in the help below. For example |--differ| will write all paths which are present +on both the source and destination but different. -The ` + "`--combined`" + ` flag will write a file (or stdout) which contains all +The |--combined| flag will write a file (or stdout) which contains all file paths with a symbol and then a space and then the path to tell you what happened to it. These are reminiscent of diff files. -- ` + "`= path`" + ` means path was found in source and destination and was identical -- ` + "`- path`" + ` means path was missing on the source, so only in the destination -- ` + "`+ path`" + ` means path was missing on the destination, so only in the source -- ` + "`* path`" + ` means path was present in source and destination but different. -- ` + "`! path`" + ` means there was an error reading or hashing the source or dest. +- |= path| means path was found in source and destination and was identical +- |- path| means path was missing on the source, so only in the destination +- |+ path| means path was missing on the destination, so only in the source +- |* path| means path was present in source and destination but different. +- |! path| means there was an error reading or hashing the source or dest. -The ` + "`--dest-after`" + ` flag writes a list file using the same format flags -as [` + "`lsf`" + `](/commands/rclone_lsf/#synopsis) (including [customizable options +The |--dest-after| flag writes a list file using the same format flags +as [|lsf|](/commands/rclone_lsf/#synopsis) (including [customizable options for hash, modtime, etc.](/commands/rclone_lsf/#synopsis)) -Conceptually it is similar to rsync's ` + "`--itemize-changes`" + `, but not identical +Conceptually it is similar to rsync's |--itemize-changes|, but not identical -- it should output an accurate list of what will be on the destination after the copy. -When the ` + "`--no-traverse`" + ` flag is set, all logs involving files that exist only +When the |--no-traverse| flag is set, all logs involving files that exist only on the destination will be incomplete or completely missing. Note that these logger flags have a few limitations, and certain scenarios are not currently supported: -- ` + "`--max-duration`" + ` / ` + "`CutoffModeHard`" + ` -- ` + "`--compare-dest`" + ` / ` + "`--copy-dest`" + ` +- |--max-duration| / |CutoffModeHard| +- |--compare-dest| / |--copy-dest| - server-side moves of an entire dir at once -- High-level retries, because there would be duplicates (use ` + "`--retries 1`" + ` to disable) +- High-level retries, because there would be duplicates (use |--retries 1| to disable) - Possibly some unusual error scenarios Note also that each file is logged during the copy, as opposed to after, so it diff --git a/cmd/move/move.go b/cmd/move/move.go index 28159d56d..342987f21 100644 --- a/cmd/move/move.go +++ b/cmd/move/move.go @@ -74,39 +74,38 @@ for more info. ## Logger Flags -The ` + "`--differ`" + `, ` + "`--missing-on-dst`" + `, ` + "`--missing-on-src`" + `, ` + - "`--match`" + ` and ` + "`--error`" + ` flags write paths, one per line, to the file name (or -stdout if it is ` + "`-`" + `) supplied. What they write is described in the -help below. For example ` + "`--differ`" + ` will write all paths which are -present on both the source and destination but different. +The |--differ|, |--missing-on-dst|, |--missing-on-src|, |--match| and |--error| flags write paths, +one per line, to the file name (or stdout if it is |-|) supplied. What they write is described +in the help below. For example |--differ| will write all paths which are present +on both the source and destination but different. -The ` + "`--combined`" + ` flag will write a file (or stdout) which contains all +The |--combined| flag will write a file (or stdout) which contains all file paths with a symbol and then a space and then the path to tell you what happened to it. These are reminiscent of diff files. -- ` + "`= path`" + ` means path was found in source and destination and was identical -- ` + "`- path`" + ` means path was missing on the source, so only in the destination -- ` + "`+ path`" + ` means path was missing on the destination, so only in the source -- ` + "`* path`" + ` means path was present in source and destination but different. -- ` + "`! path`" + ` means there was an error reading or hashing the source or dest. +- |= path| means path was found in source and destination and was identical +- |- path| means path was missing on the source, so only in the destination +- |+ path| means path was missing on the destination, so only in the source +- |* path| means path was present in source and destination but different. +- |! path| means there was an error reading or hashing the source or dest. -The ` + "`--dest-after`" + ` flag writes a list file using the same format flags -as [` + "`lsf`" + `](/commands/rclone_lsf/#synopsis) (including [customizable options +The |--dest-after| flag writes a list file using the same format flags +as [|lsf|](/commands/rclone_lsf/#synopsis) (including [customizable options for hash, modtime, etc.](/commands/rclone_lsf/#synopsis)) -Conceptually it is similar to rsync's ` + "`--itemize-changes`" + `, but not identical +Conceptually it is similar to rsync's |--itemize-changes|, but not identical -- it should output an accurate list of what will be on the destination after the move. -When the ` + "`--no-traverse`" + ` flag is set, all logs involving files that exist only +When the |--no-traverse| flag is set, all logs involving files that exist only on the destination will be incomplete or completely missing. Note that these logger flags have a few limitations, and certain scenarios are not currently supported: -- ` + "`--max-duration`" + ` / ` + "`CutoffModeHard`" + ` -- ` + "`--compare-dest`" + ` / ` + "`--copy-dest`" + ` +- |--max-duration| / |CutoffModeHard| +- |--compare-dest| / |--copy-dest| - server-side moves of an entire dir at once -- High-level retries, because there would be duplicates (use ` + "`--retries 1`" + ` to disable) +- High-level retries, because there would be duplicates (use |--retries 1| to disable) - Possibly some unusual error scenarios Note also that each file is logged during the move, as opposed to after, so it diff --git a/cmd/sync/sync.go b/cmd/sync/sync.go index ecde7d388..61804d97b 100644 --- a/cmd/sync/sync.go +++ b/cmd/sync/sync.go @@ -3,6 +3,7 @@ package sync import ( "context" + "strings" "github.com/rclone/rclone/cmd" "github.com/rclone/rclone/fs/config/flags" @@ -29,7 +30,8 @@ func init() { var commandDefinition = &cobra.Command{ Use: "sync source:path dest:path", Short: `Make source and dest identical, modifying destination only.`, - Long: `Sync the source to the destination, changing the destination + // Warning! "|" will be replaced by backticks below + Long: strings.ReplaceAll(`Sync the source to the destination, changing the destination only. Doesn't transfer files that are identical on source and destination, testing by size and modification time or MD5SUM. Destination is updated to match source, including deleting files @@ -38,7 +40,7 @@ want to delete files from destination, use the [copy](/commands/rclone_copy/) command instead. **Important**: Since this can cause data loss, test first with the -` + "`--dry-run` or the `--interactive`/`-i`" + ` flag. +|--dry-run| or the |--interactive|/|i| flag. rclone sync --interactive SOURCE remote:DESTINATION @@ -61,55 +63,54 @@ destination that is inside the source directory. Rclone will sync the modification times of files and directories if the backend supports it. If metadata syncing is required then use the -` + "`--metadata`" + ` flag. +|--metadata| flag. Note that the modification time and metadata for the root directory will **not** be synced. See https://github.com/rclone/rclone/issues/7652 for more info. -**Note**: Use the ` + "`-P`" + `/` + "`--progress`" + ` flag to view real-time transfer statistics +**Note**: Use the |-P|/|--progress| flag to view real-time transfer statistics -**Note**: Use the ` + "`rclone dedupe`" + ` command to deal with "Duplicate object/directory found in source/destination - ignoring" errors. +**Note**: Use the |rclone dedupe| command to deal with "Duplicate object/directory found in source/destination - ignoring" errors. See [this forum post](https://forum.rclone.org/t/sync-not-clearing-duplicates/14372) for more info. ## Logger Flags -The ` + "`--differ`" + `, ` + "`--missing-on-dst`" + `, ` + "`--missing-on-src`" + `, ` + - "`--match`" + ` and ` + "`--error`" + ` flags write paths, one per line, to the file name (or -stdout if it is ` + "`-`" + `) supplied. What they write is described in the -help below. For example ` + "`--differ`" + ` will write all paths which are -present on both the source and destination but different. +The |--differ|, |--missing-on-dst|, |--missing-on-src|, |--match| and |--error| flags write paths, +one per line, to the file name (or stdout if it is |-|) supplied. What they write is described +in the help below. For example |--differ| will write all paths which are present +on both the source and destination but different. -The ` + "`--combined`" + ` flag will write a file (or stdout) which contains all +The |--combined| flag will write a file (or stdout) which contains all file paths with a symbol and then a space and then the path to tell you what happened to it. These are reminiscent of diff files. -- ` + "`= path`" + ` means path was found in source and destination and was identical -- ` + "`- path`" + ` means path was missing on the source, so only in the destination -- ` + "`+ path`" + ` means path was missing on the destination, so only in the source -- ` + "`* path`" + ` means path was present in source and destination but different. -- ` + "`! path`" + ` means there was an error reading or hashing the source or dest. +- |= path| means path was found in source and destination and was identical +- |- path| means path was missing on the source, so only in the destination +- |+ path| means path was missing on the destination, so only in the source +- |* path| means path was present in source and destination but different. +- |! path| means there was an error reading or hashing the source or dest. -The ` + "`--dest-after`" + ` flag writes a list file using the same format flags -as [` + "`lsf`" + `](/commands/rclone_lsf/#synopsis) (including [customizable options +The |--dest-after| flag writes a list file using the same format flags +as [|lsf|](/commands/rclone_lsf/#synopsis) (including [customizable options for hash, modtime, etc.](/commands/rclone_lsf/#synopsis)) -Conceptually it is similar to rsync's ` + "`--itemize-changes`" + `, but not identical +Conceptually it is similar to rsync's |--itemize-changes|, but not identical -- it should output an accurate list of what will be on the destination after the sync. Note that these logger flags have a few limitations, and certain scenarios are not currently supported: -- ` + "`--max-duration`" + ` / ` + "`CutoffModeHard`" + ` -- ` + "`--compare-dest`" + ` / ` + "`--copy-dest`" + ` +- |--max-duration| / |CutoffModeHard| +- |--compare-dest| / |--copy-dest| - server-side moves of an entire dir at once -- High-level retries, because there would be duplicates (use ` + "`--retries 1`" + ` to disable) +- High-level retries, because there would be duplicates (use |--retries 1| to disable) - Possibly some unusual error scenarios Note also that each file is logged during the sync, as opposed to after, so it is most useful as a predictor of what SHOULD happen to each file (which may or may not match what actually DID.) -`, +`, "|", "`"), Annotations: map[string]string{ "groups": "Sync,Copy,Filter,Listing,Important", },