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

Version Path
rq-3.5.3 lib/rq/backer.rb
rq-3.5.1 lib/rq/backer.rb
rq-3.5.0 lib/rq/backer.rb
rq-ruby1.8-3.4.7 lib/rq/backer.rb
rq-ruby1.8-3.4.6 lib/rq/backer.rb
rq-ruby1.8-3.4.5 lib/rq/backer.rb
rq-ruby1.8-3.4.3 lib/rq/backer.rb
rq-3.0.0 lib/rq-3.0.0/backer.rb
rq-3.1.0 lib/rq-3.1.0/backer.rb
rq-3.4.0 lib/rq/backer.rb
rq-3.3.0 lib/rq/backer.rb