0

Well I guess the title is pretty self-explanatory but to put a little more words on, I want to use rsync to perform a weekly, incremental backup of my RPi4 which is hosting Pi-Hole, Unbound DNS and Wireguard VPN. The backup will be performed by the Raspberry Pi itself onto a USB stick.

While researching guides as well as ready-made scripts, I have seen several mention that you need to stop services that write to databases or ram while the backup process is running. However it wasn't clear to me if that applied to rsync or other methods like dd, etc.?

Thanks in advance.

Ingo
  • 42,961
  • 20
  • 87
  • 207

1 Answers1

2

The method of backing up is irrelevant; it applies to any (tar, rsync, scp, cpio etcetera) form of backup.

If you backup a database, and the database changes while you are backing up, you may get a copy that is inconsistent. Serious databases can often be recovered, if you backup the redo-log files last. Shutting down the database ensures that the database does not change during backup and is therefore sometimes preferred. You may also look for a tool that allows you to copy an open database (by, f.e. , making an export).

If a service runs in RAM only, the changes it makes are not written to "disk". So if you copy the disk, you will miss all the changes that have been made since the last write. Gracefully shutting down such services will probably result in an update on disk, and allows you to backup the modified data.

Ljm Dullaart
  • 2,539
  • 11
  • 16