Add "--ignore-existing" flag.

Add option to completely ignore existing files and not consider them for transfer.

Fixes #274
This commit is contained in:
klauspost 2016-01-05 11:35:36 +01:00 committed by Nick Craig-Wood
parent 5189231a34
commit 25f22ec561
4 changed files with 42 additions and 0 deletions

View file

@ -281,6 +281,11 @@ func checkOne(pair ObjectPair, out ObjectPairChan) {
if !src.Storable() {
return
}
// If we should ignore existing files, don't transfer
if Config.IgnoreExisting {
Debug(src, "Destination exists, skipping")
return
}
// Check to see if changed or not
if Equal(src, dst) {
Debug(src, "Unchanged skipping")