mirror of
https://github.com/rclone/rclone.git
synced 2024-11-07 17:14:44 +01:00
3a50f35df9
Allows rclone sync to accept the same output file flags as rclone check, for the purpose of writing results to a file. A new --dest-after option is also supported, which writes a list file using the same ListFormat flags as lsf (including customizable options for hash, modtime, etc.) 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 it has a few limitations, and certain scenarios are not currently supported: --max-duration / CutoffModeHard --compare-dest / --copy-dest (because equal() is called multiple times for the same file) server-side moves of an entire dir at once (because we never get the individual file objects in the dir) High-level retries, because there would be dupes Possibly some error scenarios that didn't come up on the tests 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.) Only rclone sync is currently supported -- support for copy and move may be added in the future.
18 lines
531 B
Go
18 lines
531 B
Go
// Package logger implements testing for the sync (and bisync) logger
|
|
package logger
|
|
|
|
import (
|
|
_ "github.com/rclone/rclone/backend/all" // import all backends
|
|
"github.com/rclone/rclone/cmd"
|
|
_ "github.com/rclone/rclone/cmd/all" // import all commands
|
|
_ "github.com/rclone/rclone/lib/plugin" // import plugins
|
|
)
|
|
|
|
// Main enables the testscript package. See:
|
|
// https://bitfieldconsulting.com/golang/cli-testing
|
|
// https://pkg.go.dev/github.com/rogpeppe/go-internal@v1.11.0/testscript
|
|
func Main() int {
|
|
cmd.Main()
|
|
return 0
|
|
}
|