mirror of
https://github.com/tuna/tunasync.git
synced 2025-04-20 11:42:43 +00:00
add an option "rsync_override"
This commit is contained in:
parent
d48815b817
commit
02468e21c0
@ -137,6 +137,7 @@ type mirrorConfig struct {
|
||||
Username string `toml:"username"`
|
||||
Password string `toml:"password"`
|
||||
RsyncOptions []string `toml:"rsync_options"`
|
||||
RsyncOverride []string `toml:"rsync_override"`
|
||||
Stage1Profile string `toml:"stage1_profile"`
|
||||
|
||||
MemoryLimit string `toml:"memory_limit"`
|
||||
|
@ -134,6 +134,7 @@ func newMirrorProvider(mirror mirrorConfig, cfg *Config) mirrorProvider {
|
||||
password: mirror.Password,
|
||||
excludeFile: mirror.ExcludeFile,
|
||||
extraOptions: mirror.RsyncOptions,
|
||||
overriddenOptions: mirror.RsyncOverride,
|
||||
workingDir: mirrorDir,
|
||||
logDir: logDir,
|
||||
logFile: filepath.Join(logDir, "latest.log"),
|
||||
|
@ -14,6 +14,7 @@ type rsyncConfig struct {
|
||||
rsyncCmd string
|
||||
upstreamURL, username, password, excludeFile string
|
||||
extraOptions []string
|
||||
overriddenOptions []string
|
||||
workingDir, logDir, logFile string
|
||||
useIPv6, useIPv4 bool
|
||||
interval time.Duration
|
||||
@ -56,6 +57,9 @@ func newRsyncProvider(c rsyncConfig) (*rsyncProvider, error) {
|
||||
"--delete", "--delete-after", "--delay-updates",
|
||||
"--safe-links", "--timeout=120", "--contimeout=120",
|
||||
}
|
||||
if overriddenOptions != nil {
|
||||
options = overriddenOptions
|
||||
}
|
||||
|
||||
if c.useIPv6 {
|
||||
options = append(options, "-6")
|
||||
|
Loading…
x
Reference in New Issue
Block a user