Skip to content

Commit cee1615

Browse files
committed
change(rclone): make stats configurable
1 parent 9579605 commit cee1615

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ CLI tool to run upload/sync jobs with rclone.
1515
rclone:
1616
config: /home/seed/.config/rclone/rclone.conf
1717
path: /usr/bin/rclone
18+
stats: 30s
1819
uploader:
1920
google:
2021
check:

config/rclone.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package config
33
type RcloneConfig struct {
44
Path string
55
Config string
6+
Stats string
67
DryRun bool `mapstructure:"dry_run"`
78
}
89

rclone/param.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package rclone
22

33
import (
4+
"github.com/l3uddz/crop/config"
45
"github.com/l3uddz/crop/pathutils"
56
)
67

@@ -20,13 +21,18 @@ func getBaseParams() ([]string, error) {
2021
"--config", cfg.Rclone.Config,
2122
// verbose
2223
"-v",
23-
// stats
24-
"--stats", "30s",
2524
// user-agent
2625
"--user-agent", "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_4) AppleWebKit/537.36 (KHTML, like Gecko) "+
2726
"Chrome/74.0.3729.131 Safari/537.36",
2827
)
2928

29+
// add stats
30+
if config.Config.Rclone.Stats != "" {
31+
params = append(params,
32+
// stats
33+
"--stats", "30s")
34+
}
35+
3036
return params, nil
3137
}
3238

0 commit comments

Comments
 (0)