plakar prune does not take into account -policy
Describe the bug
Since the fix to take account of -tag and other filters from command line (https://github.com/PlakarKorp/plakar/issues/1691) the -policy argument don't work anymore to define filters.
To Reproduce Steps to reproduce the behavior:
mkdir plakar_demoplakar at plakar_demo createplakar at plakar_demo backup -tag daily,etc /etcplakar at plakar_demo backup -tag daily,www /var/wwwplakar at plakar_demo backup /etcplakar at plakar_demo backup /var/wwwplakar at plakar_demo ls -tags2025-10-21T20:33:53Z 6f2ea3da 10 MiB 0s /var/www 2025-10-21T20:33:42Z 9b5cd90a 3.7 MiB 0s /etc 2025-10-21T20:28:56Z 4206ded8 10 MiB 0s /var/www tags=daily,www 2025-10-21T20:28:04Z a8869196 3.7 MiB 1s /etc tags=daily,etcplakar at plakar_demo prune -minutes 1 -tag daily# Work as intended on plakar 1.0.5prune: would keep 0 and delete 2 snapshot(s), run with -apply to proceed delete 2025-10-21T20:28:56Z 4206ded8 10 MiB /var/www tags=daily,www reason=outside retention windows delete 2025-10-21T20:28:04Z a8869196 3.7 MiB /etc tags=daily,etc reason=outside retention windowsplakar policy showdaily: filters: tags: - dailyplakar at plakar_demo prune -minutes 1 -policy daily# Has worked in plakar 1.0.4, but not in 1.0.5prune: would keep 0 and delete 4 snapshot(s), run with -apply to proceed delete 2025-10-21T20:33:53Z 6f2ea3da 10 MiB /var/www reason=outside retention windows delete 2025-10-21T20:33:42Z 9b5cd90a 3.7 MiB /etc reason=outside retention windows delete 2025-10-21T20:28:56Z 4206ded8 10 MiB /var/www tags=daily,www reason=outside retention windows delete 2025-10-21T20:28:04Z a8869196 3.7 MiB /etc tags=daily,etc reason=outside retention windows
Expected behavior
That all arguments work to filters snapshots as explained in plakar help prune and https://plakar.io/docs/main/commands/plakar-prune/.
So for plakar at plakar_demo prune -minutes 1 -policy daily we expect that tag defined in policy is used to filter
prune: would keep 0 and delete 2 snapshot(s), run with -apply to proceed
delete 2025-10-21T20:28:56Z 4206ded8 10 MiB /var/www tags=daily,www reason=outside retention windows
delete 2025-10-21T20:28:04Z a8869196 3.7 MiB /etc tags=daily,etc reason=outside retention windows
And for plakar at plakar_demo prune -minutes 1 -policy daily -tag etc we expect that tag defined in policy can be used and then completed with -tag argument
prune: would keep 0 and delete 1 snapshot(s), run with -apply to proceed
delete 2025-10-21T20:28:04Z a8869196 3.7 MiB /etc tags=daily,etc reason=outside retention windows
Desktop :
- OS, OS Version and architecture: Debian GNU/Linux 12 (bookworm) / amd64
- Plakar Version 1.0.5
Additional context
plakar 1.0.4 prune filter only worked with policy and now plakar 1.0.5 filters only work with command line arguments.
This can lead to unwanted prune and lost some snapshots after the update when prune use policy to filter and has been scheduled via cron or other scheduler.