diff --git a/default-rsync.lua b/default-rsync.lua index 390df1f..3eedb7f 100644 --- a/default-rsync.lua +++ b/default-rsync.lua @@ -63,6 +63,7 @@ rsync.checkgauge = { copy_links = true, copy_unsafe_links = true, cvs_exclude = true, + delete_excluded = true, dry_run = true, executability = true, existing = true, @@ -317,7 +318,7 @@ rsync.init = function local filters = inlet.hasFilters( ) and inlet.getFilters( ) - local delete = nil + local delete = {} local target = config.target @@ -337,6 +338,11 @@ rsync.init = function delete = { '--delete', '--ignore-errors' } end + if config.rsync.delete_excluded == true + then + table.insert( delete, '--delete-excluded' ) + end + if not filters and #excludes == 0 then -- starts rsync without any filters or excludes