[CLI] Prune command is only printing out the first -keep rule

Not sure if the prune command is just printing it out this way or doing it this way - but it’s confusing:

$ duplicacy prune -storage "my_storage" -id "my_hostname" -keep "1:7" -keep "7:62" -keep "30:720" -keep "365:1460" -keep "0:3650" -threads 4
Repository set to /mypath
Storage set to sftp://ruben@myserver/backups/duplicacy
Keep 1 snapshot every 1 day(s) if older than 7 day(s)
No snapshot to delete
$ 

Are the other -keep rules not processed?

Multiple -keep options must be sorted by their m values in decreasing order.

2 Likes

Side note: this is a bug.

Duplicacy could (must!) interpret the user input correctly and absolve users from performing menial busy work. Sorting, adding, subtracting, etc numbers is what computers were created for.

If only one sequence of numbers makes sense and any other is invalid — there is no excuse not to normalize user input automatically.

Same goes about the present need to sort exclusion rules, and create filler ones for intermediate directories.

It is never acceptable to force the user behavior to conform to implementation detail. It shall always be the other way around.

1 Like

I believe this was intentional – if there is a typo like -keep 0:1 among a long list then you would delete most backups. By forcing the order we may introduce some inconvenience but this makes the pruning a little bit safer.

3 Likes

Ah! thanks for the quick help! :slight_smile:

Maybe write a warning message, that there was a parse error and thus not every rule was processed.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.