How to check only the latest revision?

I’d like to run a check after every backup but it should only check the latest revision, not all of them. Is there any way to achieve this? If not, please make this a feature request.

I have tried to work around this by having backup set the tag “unchecked” and then limit prune to that tag, but I can’t seem to find a way of removing a tag (which would need to be done after the check.

1 Like

I used a “workaround” with batch files in 3 steps:

  1. Find the last log file:
for /f "tokens=*" %%a in ('dir Duplicacy*.log /b /o-d /a-d 2^>NUL') do set last_log=%%a
  1. Extract the revision number from the file found:
for /f "tokens=1,2,3,4,5,6,7,8,9,10,11,12,13* delims= " %%m in (!last_log!) do (
    if "%%p"=="revision" set "var_rev=%%q"
)    
  1. Run the check with the revision found.

Not the most elegant way, but it works!

(I really have to find time to make a revision on my scripts and make them more parameterized, well coded and “presentable” … :roll_eyes:)

2 Likes

It would also be very useful for operations that expect revision number to accept a string such as “newest” or “latest”, similar how darwinup handles it on macOS.

duplicacy backup
duplicacy list -r newest -files
3 Likes

i think the parameter should be -last, since that is its use: address the last revision.

1 Like

I was thinking about using negative numbers, like -1 for the latest, -2 for the second latest, etc. But I don’t know if all these negative numbers other than -1 are useful. If not, maybe we should just use last or newest.

1 Like

last is definitely more userfriendly than negative numbers.But I see that it would be easier to implement.

The only way numbers would make sense is if they can be used to count revisions backwards: -1 would be the newest revision, -2 the second newest, -3 the third newest and so on.

If you decide to implement it like that, I’d suggest to simply define -r latest as an alias for -r -1

6 Likes

This feature would be very useful. I’m using Nagios to monitor how long it has been since the last completed backup. At the moment my script has to list all backups and then get the time of the last one, and this can take many tens of seconds.

3 Likes

I also think having -1, -2, etc. is not that useful. (maybe even call that unintuitive) When checking my stuff, i generally tend to look either at the last revision, or do a listing of all the files in all the revisions.

imo just having -last (and not -latest since it’s longer to write and doesn’t bring anything in terms of “undersatnding” what the parameter does) added should be enough.

A post was split to a new topic: Partial commands by the minimal unabigous chunk?

To add here, it might be useful to enable checking e.g. the last 5 backups. “-2” is not that useful if it checks only the 2nd latest backup, but it is handy if checks the last two backups.

This is for users with medium levels of paranoia (well, aren’t backups for paranoids in general?)