3

How can I periodically backup the blockchain file, without copying the entire file (just the new data that was added since the last backup)?

I tried copying only the amount of bytes by which the blockchain is larger than the backup ("filling the gap"), but that didn't seem to work - the daemon failed to load the blockchain from this backup.

Jona
  • 832
  • 5
  • 16

1 Answers1

6

rsync copies what's changed:

rsync ~/.bitmonero/lmdb/data.mdb /mnt/wherever/monero-blockchain/data.mdb

This should be done when nothing is writing to the blockchain database file. If you need to copy while it is being written to, use mdb_copy:

mdb_copy ~/.bitmonero/lmdb /mnt/wherever/monero-blockchain/

Note how mdb_copy wants the directory, and not the file.

user36303
  • 34,858
  • 2
  • 57
  • 123