Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Fetching contributors…
Cannot retrieve contributors at this time
35 lines (28 sloc) 1.23 KB
Copyright © 2011 MLstate
This file is part of OPA.
OPA is free software: you can redistribute it and/or modify it under the
terms of the GNU Affero General Public License, version 3, as published by
the Free Software Foundation.
OPA is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for
more details.
You should have received a copy of the GNU Affero General Public License
along with OPA. If not, see <>.
module Io = FileIo.Make(IoUnix)
let do_backup location db_path = "Will copy from %s to %s" db_path location;
let fm = Io.make Io.ReadOnly db_path in
let copy f =
try Io.copy_file fm f ~location ""
with Failure "No cp" ->
Logger.error "Can not do a backup of the file : %s\n%!" (Io.get_name fm f)
let lst = [ Io.Node; Io.Uid; Io.Uid_rev; Io.Timestamp; Io.Flags; Io.Trans; Io.Db_state; Io.Config ] in
List.iter copy lst;
Io.close fm; "Finished to copy %s to %s\n%!" db_path location;
let fm = IoManager.create `append location in
IoManager.close fm
Jump to Line
Something went wrong with that request. Please try again.