diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..722d5e7 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.vscode diff --git a/README.md b/README.md index 1b9bf12..e819d20 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ Repository contains some helpful tools: - raw rsync wrapper -- rsync task — wrapper which provide important information about rsync task: progress, remain items, total items and speed +- rsync task — wrapper which provide important information about rsync task: progress, remain items, total items and speed ## Task wrapper usage diff --git a/rsync.go b/rsync.go index cc69a35..252a36d 100644 --- a/rsync.go +++ b/rsync.go @@ -187,6 +187,8 @@ type RsyncOptions struct { Info string // Exclude --exclude="", exclude remote paths. Exclude []string + // ExcludeFrom --exclude-from="", read exclude patterns from FILE + ExcludeFrom string // Include --include="", include remote paths. Include []string // Filter --filter="", include filter rule. @@ -597,6 +599,10 @@ func getArguments(options RsyncOptions) []string { } } + if options.ExcludeFrom != "" { + arguments = append(arguments, fmt.Sprintf("--exclude-from=%s", options.ExcludeFrom)) + } + if options.Filter != "" { arguments = append(arguments, fmt.Sprintf("--filter=%s", options.Filter)) }