DB backup does not work

backup

#21

I was just testing this on linux mint 18.2 and with the backupsqlitekeepdays=1 as soon as you go over 9 days it stops working as as log as its a single digit it works


#22

If I get time in the following days, on my Pi-3, I will see what the value is being cast and treated as. When I checked the architecture on my Raspberry Pi 3, Linux reported it as a 32-bit architecture (arm7l). I am pretty sure it is a Pi 3 as that is what I ordered and it does have WiFi and Bluetooth. Now, it could the OS itself, I haven’t really dug into this.

So, an option, like I mentioned, may be to turn this from milliseconds into seconds, or even minutes, during the calculation process, and make sure all is well at that point. I might also need to force a cast to Long in case the JVM isn’t doing it properly by itself (but, in theory, it is supposed to be that smart).

On my MacBook, I just set the value to 20, and it continues to backup without a problem.

Cheers


#23

It is as I thought on the Pi, which, is running a 32-bit OS (if what I read is correct).

This is the calculation method currently, from my Pi 3, using 30 days:

[10-11-2017 @ 21:11:47.652 MDT] >> 1507777907651 -1702967296
[10-11-2017 @ 21:11:47.687 MDT] >> 1507777907686 -1702967296

The last number of the number of milliseconds in a day times the number of days configured, as one can see, it rolls over. How so, you ask? A 32-bit integer, unsigned max is 4,294,967,295. Subtract 2,592,000,000 from 4,294,967,295 and you get 1,702,967,295. The above number, off by one due to roll over and the storage of the negative bit.

So, if we calculate by seconds instead of milliseconds:

[10-11-2017 @ 21:15:00.229 MDT] >> 1507778100 2592000

We have a much better number when using 30 days and the file isn’t automatically removed:

illusion% ls dbbackup/
phantombot.auto.backup.11102017.091458.db

Fixed in 1711. The fix should allow you to go up to over 24,000 days. I assume no one needs that many backups.


#24

Related to the Pi, good read:

https://www.raspberrypi.org/forums/viewtopic.php?t=138385

It seems to indicate that there needs to be a 64-bit kernel created so that there can be a 64-bit OS. Hence why the OS still “detects” the CPU as a 32-bit CPU (arm7l) rather than a 64-bit (arm8).

Cheers


#25

I guess I’ll just have to make do with 24k days. :slight_smile:

Thanks


#26

Thanks for the link. Definitely good to know.


#27

Welcome. I hadn’t really looked too much into this before, so, was news to me.


#28

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.