From a29380762b93737ae6949121010cd9bceb8196b2 Mon Sep 17 00:00:00 2001 From: Steve Kemp Date: Wed, 3 Jun 2015 15:55:28 +0100 Subject: Relocated the binaries to bin/ --- byteback-snapshot | 40 ---------------------------------------- 1 file changed, 40 deletions(-) delete mode 100755 byteback-snapshot (limited to 'byteback-snapshot') diff --git a/byteback-snapshot b/byteback-snapshot deleted file mode 100755 index fc9aab3..0000000 --- a/byteback-snapshot +++ /dev/null @@ -1,40 +0,0 @@ -#!/usr/bin/ruby -# -# Program to create a snapshot and/or rotate a directory of backup snapshots -# using btrfs subvolume commands. -# - -$LOAD_PATH.unshift('/usr/lib/byteback') - -require 'trollop' -require 'byteback' -include Byteback -include Byteback::Log - -opts = Trollop.options do - opt :root, 'Backups directory (must be a btrfs subvolume)', - type: :string - - opt :snapshot, '(ignored for compatibility)' - - opt :verbose, 'Print diagnostics' -end - -@root = opts[:root] -@verbose = opts[:verbose] - -fatal('--root not readable') unless File.directory?("#{@root}") - -@backups = BackupDirectory.new(@root) -snapshots = @backups.snapshots - -unless snapshots.empty? - last_snapshot_time = snapshots.last.time - fatal('Last snapshot was less than six hours ago') unless - !last_snapshot_time || - Time.now - last_snapshot_time >= 6 * 60 * 60 # FIXME: make configurable -end - -info 'Making new snapshot' -@backups.new_snapshot! -info 'Finished' -- cgit v1.2.3