Skip to content

"most recent backup" judgement is too tight #162

@GuitarBilly

Description

@GuitarBilly

I think this is applicable for all npbackup versions on all OS

steps to reproduce

So I had npbackup on a cronjob */15 * * * *.
This I call the 'laptop' schedule, i.e. run every 15 mins and check the most recent backup is less than "one day / 24 hours". Perfect to have a highest chance to get a backup every day with unknown on and off times.

Now the result of this on an always-on machine is that the backup moves every day with 15 minutes:

Image

The reason is that at the +24 hour mark the conclusion in the log is always that there is a recent backup and backup will be skipped.
So is there too much slack in my scheduler timing or is npbackup check for recent 24 hour backup too strict or both?

expected behaviour

i'd expect if more than say 23:59 time is elapsed, it is OK to have another backup. This will prevent a racing condition and a moving backup.

daily cron schedule

I can also replicate this with my current daily crontjob 01 2 * * * :

~/npbackup$ grep "2025-05-1"[345]" 02:0" npbackup-cli.log |grep syncthing
2025-05-13 02:00:03,112 :: INFO :: Most recent backup in repo syncthing is from 2025-05-12 02:00:04.156897+02:00
 >>> note that on 14th of May i changed the syncthing cronjob from 02:00 to 02:01 to prevent clash with another */15 cronjob. <<<
2025-05-14 02:01:03,177 :: INFO :: No recent backup found in repo syncthing. Newest is from 2025-05-12 02:00:04.156897+02:00
2025-05-14 02:01:03,177 :: INFO :: Running backup of ['/home/ubuntu/containers/syncthing'] to repo syncthing
2025-05-15 02:01:03,128 :: INFO :: Most recent backup in repo syncthing is from 2025-05-14 02:01:03.938439+02:00

From above log, the 13th May and 15th May they suffer from the too tight recent backup judgement.
When run, if the previous day backup job is only 1msec earlier then npbackup concludes that a new backup is not required and will skip the backup!

Metadata

Metadata

Assignees

Labels

questionFurther information is requested

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions