operations: fix use of --suffix without --backup-dir

As part of the original work adding this feature it was overlooked
that this didn't actually work for full rclone copy/sync.

This commit fixes the problem and adds a test to make sure it stays
working.

See: https://forum.rclone.org/t/suffix-not-working-on-folder-upload-via-ssh-sftp/19526
This commit is contained in:
Nick Craig-Wood
2020-10-04 16:38:29 +01:00
parent 2b7994e739
commit db4bbf9521
3 changed files with 45 additions and 17 deletions

View File

@ -1253,11 +1253,17 @@ or with `--backup-dir`. See `--backup-dir` for more info.
For example
rclone sync -i /path/to/local/file remote:current --suffix .bak
rclone copy -i /path/to/local/file remote:current --suffix .bak
will sync `/path/to/local` to `remote:current`, but for any files
will copy `/path/to/local` to `remote:current`, but for any files
which would have been updated or deleted have .bak added.
If using `rclone sync` with `--suffix` and without `--backup-dir` then
it is recommended to put a filter rule in excluding the suffix
otherwise the `sync` will delete the backup files.
rclone sync -i /path/to/local/file remote:current --suffix .bak --exclude "*.bak"
### --suffix-keep-extension ###
When using `--suffix`, setting this causes rclone put the SUFFIX