Skip to content

Commit

Permalink
rclone: use server mod time by default
Browse files Browse the repository at this point in the history
This prevents rclone from performing a HEAD request for each file when
listing objects.

fixes #3046

(cherry picked from commit 63b985f)
  • Loading branch information
kevinbarbour authored and mmatczuk committed Feb 23, 2022
1 parent 113a9ad commit 3d91538
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion pkg/config/testdata/agent/auth_token_overwrite.golden.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ rclone:
stats_file_name_length: 45
ask_password: true
password_command: []
use_server_mod_time: false
use_server_mod_time: true
max_transfer: -1
max_duration: 0s
cutoff_mode: 0
Expand Down
2 changes: 1 addition & 1 deletion pkg/config/testdata/agent/basic.golden.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ rclone:
stats_file_name_length: 45
ask_password: true
password_command: []
use_server_mod_time: false
use_server_mod_time: true
max_transfer: -1
max_duration: 0s
cutoff_mode: 0
Expand Down
2 changes: 1 addition & 1 deletion pkg/config/testdata/agent/debug_overwrite.golden.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ rclone:
stats_file_name_length: 45
ask_password: true
password_command: []
use_server_mod_time: false
use_server_mod_time: true
max_transfer: -1
max_duration: 0s
cutoff_mode: 0
Expand Down
2 changes: 1 addition & 1 deletion pkg/config/testdata/agent/https_overwrite.golden.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ rclone:
stats_file_name_length: 45
ask_password: true
password_command: []
use_server_mod_time: false
use_server_mod_time: true
max_transfer: -1
max_duration: 0s
cutoff_mode: 0
Expand Down
2 changes: 1 addition & 1 deletion pkg/config/testdata/agent/prometheus_overwrite.golden.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ rclone:
stats_file_name_length: 45
ask_password: true
password_command: []
use_server_mod_time: false
use_server_mod_time: true
max_transfer: -1
max_duration: 0s
cutoff_mode: 0
Expand Down
2 changes: 1 addition & 1 deletion pkg/config/testdata/agent/scylla_overwrite.golden.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ rclone:
stats_file_name_length: 45
ask_password: true
password_command: []
use_server_mod_time: false
use_server_mod_time: true
max_transfer: -1
max_duration: 0s
cutoff_mode: 0
Expand Down
4 changes: 3 additions & 1 deletion pkg/rclone/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const (
// GlobalOptions is an alias for rclone fs.ConfigInfo.
type GlobalOptions = fs.ConfigInfo

// DefaultGlobalOptions returns rclong fs.ConfigInfo initialized with default
// DefaultGlobalOptions returns rclone fs.ConfigInfo initialized with default
// values.
func DefaultGlobalOptions() GlobalOptions {
c := fs.NewConfig()
Expand All @@ -50,6 +50,8 @@ func DefaultGlobalOptions() GlobalOptions {
c.NoTraverse = true
// Explicitly disable deletes as enabling them turns off NoTraverse.
c.DeleteMode = fs.DeleteModeOff
// Use modification time from server ListObjects request.
c.UseServerModTime = true

// The number of checkers to run in parallel.
// Checkers do the equality checking of files (local vs. backup location)
Expand Down

0 comments on commit 3d91538

Please sign in to comment.