Prune fails running my retention rules

I configured a cron job that runs daily at 3:30 and the backups are created. No other backups are created after that. So far so good.
But what I do not understand is that despite my retention rules all snapshot are held.
The commands in the shell script that is executed by the cron daemon are as follow:

    > 
    >     ~/bin/duplicacy  backup >> norbu_db_backup.log  2<&1                                                                                                                                          
    >                                                                                                                                                                                                   
    >     ~/bin/duplicacy -log prune -keep 0:360 -keep 30:180 -keep 7:30 -keep 1:7 >> norbu_db_backup.log 2>&1    

The list of snapshots show this:

    > norbu@lynx Database]$ duplicacy list
    > Storage set to sftp://ekayana@peacock.uberspace.de/Backup/Duplicate-Norbu
    > Snapshot norbu_db revision 1 created at 2018-09-16 03:30 -hash
    > Snapshot norbu_db revision 2 created at 2018-09-17 03:30 
    > Snapshot norbu_db revision 3 created at 2018-09-18 03:30 
    > Snapshot norbu_db revision 4 created at 2018-09-19 03:30 
    > Snapshot norbu_db revision 5 created at 2018-09-20 03:30 
    > Snapshot norbu_db revision 6 created at 2018-09-21 03:30 
    > Snapshot norbu_db revision 7 created at 2018-09-22 03:30 
    > Snapshot norbu_db revision 8 created at 2018-09-23 03:30 
    > Snapshot norbu_db revision 9 created at 2018-09-24 03:30 
    > Snapshot norbu_db revision 10 created at 2018-09-25 03:30 
    > Snapshot norbu_db revision 11 created at 2018-09-26 03:30 
    > Snapshot norbu_db revision 12 created at 2018-09-27 03:30 
    > Snapshot norbu_db revision 13 created at 2018-09-28 03:30 
    > Snapshot norbu_db revision 14 created at 2018-09-29 03:30 
    > Snapshot norbu_db revision 15 created at 2018-09-30 03:30 
    > Snapshot norbu_db revision 16 created at 2018-10-01 03:30 
    > Snapshot norbu_db revision 17 created at 2018-10-02 03:30 
    > Snapshot norbu_db revision 18 created at 2018-10-03 03:30 

I think the rule that says “keep 1 snapshot for snapshots older than 7 days” are not working.

Thank you

As per guide:

duplicacy prune -keep 1:7       # Keep a snapshot per (1) day for snapshots older than 7 days

So for anything older than 7 days, the interval between backups will be kept at minimum 1 day apart. If you did multiple backups per day, only the first one each day will be kept.

Thus, your -keep 1:7 rule you might as well not have, since you only do daily backups.

Your next rule -keep 7:30 will only kick in in a couple weeks time, when revision 2 should get deleted because 1) it’s over 30 days old, and 2) it’s less than 7 days since revision 1, the last kept backup. The next day, revision 3 gets deleted because it shifts into the 30 day range and is less than 7 days since the last kep backup (rev 1).

As backups and prunes continue, you should have daily backups for 30 days, weekly backups for the last 6 months-ish, and no backups beyond a year.

2 Likes