digint / btrbk

Tool for creating snapshots and remote backups of btrfs subvolumes
https://digint.ch/btrbk/
GNU General Public License v3.0
1.7k stars 123 forks source link

Is there anything bad that can happen from not using lock files? #441

Open KodyVB opened 2 years ago

KodyVB commented 2 years ago

If I'm not mistaken, using lock files would make it so btrbk won't run twice at the same time, and just prevents the extra instances of btrbk from running if there already is one (as opposed to queuing them up or something). So my question is: so long as you're taking snapshots of different subvolumes, going into different destinations, is there anything bad that can happen from not using lock files so multiple instances of btrbk can run simultaneously?

For example, if I was taking snapshots of my home directory every hour and sending them to their own snapshot directory, and taking snapshots of my root directory every 4 hours and sending them to a separate snapshot directory, all scheduled via cron jobs, then there would be that overlap every 4 hours. But is there some kind of problem that could arise from doing that?

I guess ultimately I'm trying to figure out when lock files are needed/recommended and when they're not.

digint commented 2 years ago

nothing really bad can happen, the locking merely makes sure that no errors occur. E.g. btrbk might print errors if the same backup is to be created, by running btrbk resume at the same time.

fwiw I'm running btrbk without lock files on all instances since years, without any issues.