My understanding is that the current locking behaviour is that the 'server.database.backup' service:
- requires the database to be unlocked
- locks the database
- makes the backup
- unlocks the database.
If you wanted to backup the database and the file-store, then you might do this:
server.database.backup :url file:///$dir/database
server.database.lock :action abort :msg "Backing up assets"
exec /bin/tar cvfz $dir/assets.tar.gz $stores
server.database.unlockbut that doesn't give you an atomic snapshot ... because there is a window between the database backup ending and the lock being re-acquired.
How about something like this?
server.database.lock :action abort :msg "Backing up database and assets"
server.database.backup :url file:///$dir/database :use-existing-lock true
exec /bin/tar cvfz $dir/assets.tar.gz $stores
server.database.unlockwhere ":use-existing-lock true" *requires* the database to be already locked by the current session.
-- Steve