Sha256: 7e31fa02632529c2700d2718a67bf666c9a8097f6d0a2b65ab2e35c12d3a3dec
Contents?: true
Size: 807 Bytes
Versions: 11
Compression:
Stored size: 807 Bytes
Contents
unless defined? $__rq_backer__ module RQ #--{{{ LIBDIR = File::dirname(File::expand_path(__FILE__)) + File::SEPARATOR unless defined? LIBDIR require LIBDIR + 'mainhelper' # # a Backer object makes an (optionally) timestamped hot backup/snapshot of a # queue using a timestamp of milli second resolution. # class Backer < MainHelper #--{{{ def backup #--{{{ set_q bak = @argv.shift bak ||= "#{ @qpath }.#{ Util::timestamp.gsub(/[:\s\.-]/,'_') }.bak" raise "<#{ bak }> exists" if bak and test(?e, bak) debug{ "bak <#{ bak }>" } @q.lock{ FileUtils::cp_r @qpath, bak } info{ "created backup <#{ bak }>" } #--}}} end #--}}} end # class Backer #--}}} end # module RQ $__rq_backer__ = __FILE__ end
Version data entries
11 entries across 11 versions & 2 rubygems