Sha256: 5074f610ae6c318e5dbfe628c56690149745fe832d7ff444773190be896446c1

Contents?: true

Size: 685 Bytes

Versions: 1

Compression:

Stored size: 685 Bytes

Contents

#!/usr/bin/env ruby
# frozen_string_literal: true

require "bup"
require "optparse"

configfile = File.join(ENV["HOME"], ".buprc")
config = Bup::Config.new

OptParse.new do |opt|
  opt.banner = "#{$PROGRAM_NAME} #{Bup::VERSION}"

  opt.on("-c", "--config=file", String, "Config file.") do |c|
    configfile = c
  end

  opt.on("-p", "--profile=profile", String, "Profile name.") do |p|
    config.runtime["profile"] = p
  end

  opt.on("-t", "--type=type", String, "Type of backup.") do |t|
    config.runtime["type"] = t == "incremental" ? t : "full"
  end
end.parse!

config.load(configfile) if File.exist?(configfile)

tar = Bup::Tar.new(config)

tar.call

config.save(configfile)

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
bup-0.1.0 exe/bup