'when' parameter parsed incorrectly for day of month < 10
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/backupninja.in. 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.
#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".