File tree Expand file tree Collapse file tree 2 files changed +10
-3
lines changed
Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Original file line number Diff line number Diff line change 422422| ` RSYNC_DELETE_EXCLUDED ` | Defaults to ` true ` . Use ` --delete-excluded ` to delete excluded files. |
423423| ` RSYNC_MAXDELETE ` | Maximum number of files that can be removed. Defaults to ` 4000 ` . |
424424| ` RSYNC_RSH ` | Specify the remote shell, e.g. ` ssh -i /path/to/key ` . |
425+ | ` RSYNC_NO_DELETE ` | Defaults to ` false ` . Set to ` true ` to disable all deletion arguments. |
425426
426427### rubygems / rubygems-dynamic
427428
Original file line number Diff line number Diff line change @@ -23,13 +23,16 @@ RSYNC_DELAY_UPDATES="${RSYNC_DELAY_UPDATES:-true}"
2323RSYNC_SPARSE=" ${RSYNC_SPARSE:- true} "
2424RSYNC_DELETE_DELAY=" ${RSYNC_DELETE_DELAY:- true} "
2525RSYNC_DELETE_EXCLUDED=" ${RSYNC_DELETE_EXCLUDED:- true} "
26+ RSYNC_NO_DELETE=" ${RSYNC_NO_DELETE:- false} "
2627
2728opts=" -pPrltvH --partial-dir=.rsync-partial --timeout ${RSYNC_TIMEOUT} --safe-links"
2829
2930[[ -n $RSYNC_USER ]] && RSYNC_HOST=" $RSYNC_USER @$RSYNC_HOST "
3031
31- [[ $RSYNC_DELETE_EXCLUDED = true ]] && opts+=' --delete-excluded'
32- [[ $RSYNC_DELETE_DELAY = true ]] && opts+=' --delete-delay' || opts+=' --delete'
32+ if [[ $RSYNC_NO_DELETE != true ]]; then
33+ [[ $RSYNC_DELETE_EXCLUDED = true ]] && opts+=' --delete-excluded'
34+ [[ $RSYNC_DELETE_DELAY = true ]] && opts+=' --delete-delay' || opts+=' --delete'
35+ fi
3336[[ $RSYNC_DELAY_UPDATES = true ]] && opts+=' --delay-updates'
3437[[ $RSYNC_SPARSE = true ]] && opts+=' --sparse'
3538[[ $RSYNC_BLKSIZE -ne 0 ]] && opts+=" --block-size ${RSYNC_BLKSIZE} "
5457 RSYNC_URL=" rsync://$RSYNC_HOST /$RSYNC_PATH "
5558fi
5659
57- exec rsync $RSYNC_EXCLUDE --filter=" merge $filter_file " --bwlimit " $RSYNC_BW " --max-delete " $RSYNC_MAXDELETE " $opts $RSYNC_EXTRA " $RSYNC_URL " " $TO "
60+ max_delete_arg=" --max-delete $RSYNC_MAXDELETE "
61+ [[ $RSYNC_NO_DELETE = true ]] && max_delete_arg=' '
62+
63+ exec rsync $RSYNC_EXCLUDE --filter=" merge $filter_file " --bwlimit " $RSYNC_BW " $max_delete_arg $opts $RSYNC_EXTRA " $RSYNC_URL " " $TO "
You can’t perform that action at this time.
0 commit comments