Sha256: a592826d87de1334feee9233dd5bdee3c6eec134137ecd73e33419f2ee402e22

Contents?: true

Size: 1.03 KB

Versions: 28

Compression:

Stored size: 1.03 KB

Contents


module Rudy
  module CLI
    class Backups < Rudy::CLI::CommandBase

      
      def backups
        blist = get_backups
        print_stobjects blist
      end
      
      def backups_wash
        dirt = (get_backups || []).select { |b| !b.snapshot_exists? }
        if dirt.empty?
          li "Nothing to wash in #{current_machine_group}"
          return
        end
        
        li "The following backup metadata will be deleted:"
        li dirt.collect {|b| b.name }
        
        execute_check(:medium)

        dirt.each do |b|
          b.destroy
        end
        
      end
      
      def backups_create_valid?
        @dlist = Rudy::Disks.list
        raise "No disks" if @dlist.nil?
        raise "No path provided" unless @argv.first
        raise "Disk does not exist" unless Rudy::Disks.exists? @argv.first
        true
      end
      
      def backups_create
        @dlist.each do |d|
          li "Creating backup for #{d.name}"
          back = d.archive
          li back
        end
      end
      
    end
  end
end

Version data entries

28 entries across 28 versions & 2 rubygems

Version Path
solutious-rudy-0.9.4 lib/rudy/cli/backups.rb
rudy-0.9.8.020 lib/rudy/cli/backups.rb
rudy-0.9.8.019 lib/rudy/cli/backups.rb
rudy-0.9.8.018 lib/rudy/cli/backups.rb
rudy-0.9.8.017 lib/rudy/cli/backups.rb
rudy-0.9.8.016 lib/rudy/cli/backups.rb
rudy-0.9.8.015 lib/rudy/cli/backups.rb
rudy-0.9.8.014 lib/rudy/cli/backups.rb
rudy-0.9.8.013 lib/rudy/cli/backups.rb
rudy-0.9.8.012 lib/rudy/cli/backups.rb
rudy-0.9.8.011 lib/rudy/cli/backups.rb
rudy-0.9.8.010 lib/rudy/cli/backups.rb
rudy-0.9.8.009 lib/rudy/cli/backups.rb
rudy-0.9.8.008 lib/rudy/cli/backups.rb
rudy-0.9.8.007 lib/rudy/cli/backups.rb
rudy-0.9.8.006 lib/rudy/cli/backups.rb
rudy-0.9.8.005 lib/rudy/cli/backups.rb
rudy-0.9.8.004 lib/rudy/cli/backups.rb
rudy-0.9.8.003 lib/rudy/cli/backups.rb
rudy-0.9.8.002 lib/rudy/cli/backups.rb