Closed ceremcem closed 2 years ago
Not sure if I fully understand your problem, but have you tried separating snapshot creation (btrbk snapshot
, which can be done without lockfile, as those operations are atomic), and snapshot deletion (btrbk prune
, where you might want to wait for the lock).
Sorry for the late reply, was very busy lately...
Yes, I also think that I told the story in a very complicated way.
My workaround: I just used the same lock file for the internal backup process and external backup process. There is no problem in practice.
Regarding to being late: It's okay, this is a non-profit project. It happens.
My use case:
I'm using an
internal_backup_disk
and anexternal_backup_disk
for myrootfs_backups
.Internal backup process can be run in parallel to the external backup process, so I can't use the same lock file for both of them.
However, my
rootfs_backups
may interfere with both of the internal and external process becauserootfs_backups
does rotate the old snapshots. Any of the (in|ex)ternal disks might just rename the "THE_OLD_TIMESTAMP.A_SUFFIX_TO_PREVENT_DELETION" snapshots to THE_OLD_TIMESTAMP and start synchronization. In the meanwhile,rootfs_backups
process might delete the snapshots which has THE_OLD_TIMESTAMP because they have the old timestamp. But we need the old snapshots till the end of the (in|ex)ternal backup processes.So,
rootfs_backups
must wait for any of the (in|ex)ternal backup process but internal backup process shouldn't wait for the external backup process, so, I can't use the same lock file for all of them.How can I make such a configuration?