diff options
author | Patrick J Cherry <patrick@bytemark.co.uk> | 2017-01-31 11:12:14 +0000 |
---|---|---|
committer | Patrick J Cherry <patrick@bytemark.co.uk> | 2017-01-31 11:12:14 +0000 |
commit | 38c89a9e32a67f96b40d756a5c356f8c31247ab9 (patch) | |
tree | 88fbff9457a32abd5f72d89481bf3a52a0471f75 /lib/byteback/backup_directory.rb | |
parent | 566c4c39e58e001015d263df124ea88d06ba5940 (diff) | |
parent | b310c2f150a4802d63d492cfe3dfae650ebbc41e (diff) |
Merge branch '12-fix-btrfs-path' into rubocop
Diffstat (limited to 'lib/byteback/backup_directory.rb')
-rw-r--r-- | lib/byteback/backup_directory.rb | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/byteback/backup_directory.rb b/lib/byteback/backup_directory.rb index 89b0ae9..a39cf84 100644 --- a/lib/byteback/backup_directory.rb +++ b/lib/byteback/backup_directory.rb @@ -1,6 +1,11 @@ +require 'byteback/utils' + module Byteback # Represents a particular timestamped backup directory class Snapshot + + include Byteback::Util + class << self # What order to remove snapshots in to regain disk space? # @@ -111,11 +116,11 @@ module Byteback end def create!(from) - system_no_error("/sbin/btrfs subvolume snapshot #{from} #{path}") + system_no_error("#{btrfs_bin} subvolume snapshot #{from} #{path}") end def delete! - system_no_error("/sbin/btrfs subvolume delete #{path}") + system_no_error("#{btrfs_bin} subvolume delete #{path}") end # Returns the size of the given snapshot (runs du, may be slow) |