I want to backup the
pacman sync databases after an execution of
pacman -Sy, creating "restore points" which
pacman -Suu can use to reverse a failed system upgrade. Further background can be found here.
I want to manually lock the pacman databases via
/var/lib/pacman/db.lck to ensure that the databases are not changed while being saved / restored.
How to I atomically check/create