diff --git a/internal/backend/rclone/backend.go b/internal/backend/rclone/backend.go index f54625f94..339db3bd1 100644 --- a/internal/backend/rclone/backend.go +++ b/internal/backend/rclone/backend.go @@ -127,8 +127,6 @@ func New(cfg Config, lim limiter.Limiter) (*Backend, error) { return nil, err } args = append(args, a...) - } else { - args = append(args, "rclone") } // then add the arguments @@ -139,10 +137,6 @@ func New(cfg Config, lim limiter.Limiter) (*Backend, error) { } args = append(args, a...) - } else { - args = append(args, - "serve", "restic", "--stdio", - "--b2-hard-delete", "--drive-use-trash=false") } // finally, add the remote diff --git a/internal/backend/rclone/config.go b/internal/backend/rclone/config.go index c2c5d88f9..40b0f8905 100644 --- a/internal/backend/rclone/config.go +++ b/internal/backend/rclone/config.go @@ -15,15 +15,19 @@ type Config struct { Connections uint `option:"connections" help:"set a limit for the number of concurrent connections (default: 5)"` } +var defaultConfig = Config{ + Program: "rclone", + Args: "serve restic --stdio --b2-hard-delete --drive-use-trash=false", + Connections: 5, +} + func init() { options.Register("rclone", Config{}) } // NewConfig returns a new Config with the default values filled in. func NewConfig() Config { - return Config{ - Connections: 5, - } + return defaultConfig } // ParseConfig parses the string s and extracts the remote server URL. diff --git a/internal/backend/rclone/config_test.go b/internal/backend/rclone/config_test.go index a59e5fb53..d9dcdc251 100644 --- a/internal/backend/rclone/config_test.go +++ b/internal/backend/rclone/config_test.go @@ -14,7 +14,9 @@ func TestParseConfig(t *testing.T) { "rclone:local:foo:/bar", Config{ Remote: "local:foo:/bar", - Connections: 5, + Program: defaultConfig.Program, + Args: defaultConfig.Args, + Connections: defaultConfig.Connections, }, }, }