Bug #9397

'when' parameter parsed incorrectly for day of month < 10

Added by ngaur about 3 years ago. Updated about 2 years ago.

Target version:
Start date:
Due date:
% Done:


QA Check:


I've got a backup which is supposed to run on the first of the month, but which has not been doing so. I've tracked it down to a bug in `function isnow()` in src/ The date function used to calculate `nowday` gives a zero-padded 2 digit day number, while the mechanism for calculating `whenday` does not do the zero-padding, so the comparison fails.

I've attached a diff, which I think is correct, but I've yet to test it fully, as I'm not yet sure how to do that without waiting for the date to roll around. Stepping through line by line in bash, and assuming the SED substitution behaves as I expect, it looks fine. View (467 Bytes) ngaur, 05/13/2015 03:27 PM


#1 Updated by ngaur about 3 years ago

I'm having a hard time believing that a bug like this could sit around for years without being noticed. Maybe there's something specific to my system?

It's debian wheezy. Not sure what other details are important, but happy to answer any questions.

In case it's not clear, an example of a `when spec that fails is "when = 1st at 18:00".

#2 Updated by ngaur about 2 years ago

The diff here has been in production use for some time now. Consider it tested.

#3 Updated by timewulf about 2 years ago

ngaur wrote:

The diff here has been in production use for some time now. Consider it tested.

I had the same problem on three debian production servers today. I patched backupninja manually this way, tried again and the error is gone.

#4 Updated by timewulf about 2 years ago

As this bug is critical for monthly backup schedules (This appears in my case ...): May we create a new version build so the different distributions may update there packages?

Also available in: Atom PDF