Suggested enhancement to server.database.backup

4 views
Skip to first unread message

Stephen Crawley

unread,
Feb 3, 2014, 11:47:47 PM2/3/14
to medi...@googlegroups.com
My understanding is that the current locking behaviour is that the 'server.database.backup' service:
  1. requires the database to be unlocked
  2. locks the database
  3. makes the backup
  4. 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.unlock


but 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.unlock


where ":use-existing-lock true" *requires* the database to be already locked by the current session.

-- Steve
Reply all
Reply to author
Forward
0 new messages