Skip to content

"rsync for cloud storage" - Google Drive, S3, Dropbox, Backblaze B2, One Drive, Swift, Hubic, Wasabi, Google Cloud Storage, Azure Blob, Azure Files, Yandex Files

filter: fix --min-age and --max-age together check

Nick Craig-Wood764440068eda
diff --git a/fs/filter/filter.go b/fs/filter/filter.go
index 9a9f79994..fd4da9676 100644
--- a/fs/filter/filter.go
+++ b/fs/filter/filter.go
@@ -130,7 +130,7 @@ func NewFilter(opt *Opt) (f *Filter, err error) {
}
if f.Opt.MaxAge.IsSet() {
f.ModTimeFrom = time.Now().Add(-time.Duration(f.Opt.MaxAge))
- if !f.ModTimeTo.IsZero() && f.ModTimeFrom.Before(f.ModTimeTo) {
+ if !f.ModTimeTo.IsZero() && f.ModTimeTo.Before(f.ModTimeFrom) {
log.Fatal("filter: --min-age can't be larger than --max-age")
}
fs.Debugf(nil, "--max-age %v to %v", f.Opt.MaxAge, f.ModTimeFrom)