Class: Snapsync::SubvolumeInfo
- Inherits:
-
Object
- Object
- Snapsync::SubvolumeInfo
- Defined in:
- lib/snapsync/btrfs_subvolume.rb
Instance Attribute Summary collapse
-
#absolute_dir ⇒ String
readonly
The absolute path in the btrfs filesystem.
- #btrfs ⇒ Btrfs readonly
- #creation_time ⇒ String readonly
- #flags ⇒ String readonly
- #gen_at_creation ⇒ Integer readonly
- #generation ⇒ Integer readonly
- #name ⇒ String readonly
- #parent_id ⇒ Integer readonly
-
#parent_uuid ⇒ String
readonly
Denotes a subvolume that’s a direct parent in the snapshot’s timeline.
- #receive_time ⇒ String readonly
-
#receive_transid ⇒ Integer
readonly
The transaction of id of the start of the receive.
-
#received_uuid ⇒ String
readonly
Denotes the UUID of the subvolume sent by ‘btrfs send’.
- #send_time ⇒ String readonly
-
#send_transid ⇒ Integer
readonly
A transaction id in the sending btrfs filesystem for the ‘btrfs send` action.
- #snapshots ⇒ Array<String> readonly
- #subvolume_dir ⇒ AgnosticPath readonly
- #subvolume_id ⇒ Integer readonly
- #top_level_id ⇒ Integer readonly
- #uuid ⇒ String readonly
Instance Method Summary collapse
-
#initialize(subvolume_dir) ⇒ SubvolumeInfo
constructor
A new instance of SubvolumeInfo.
Constructor Details
#initialize(subvolume_dir) ⇒ SubvolumeInfo
Returns a new instance of SubvolumeInfo.
89 90 91 92 93 94 95 96 97 98 99 100 101 |
# File 'lib/snapsync/btrfs_subvolume.rb', line 89 def initialize(subvolume_dir) @subvolume_dir = subvolume_dir @btrfs = Btrfs.get(subvolume_dir) integers = Set[:subvolume_id, :generation, :gen_at_creation, :parent_id, :top_level_id, :send_transid, :receive_transid] btrfs.subvolume_show(subvolume_dir).each do |k, v| if integers.include? k.to_sym instance_variable_set '@'+k, Integer(v) else instance_variable_set '@'+k, v end end end |
Instance Attribute Details
#absolute_dir ⇒ String (readonly)
The absolute path in the btrfs filesystem
30 31 32 |
# File 'lib/snapsync/btrfs_subvolume.rb', line 30 def absolute_dir @absolute_dir end |
#btrfs ⇒ Btrfs (readonly)
23 24 25 |
# File 'lib/snapsync/btrfs_subvolume.rb', line 23 def btrfs @btrfs end |
#creation_time ⇒ String (readonly)
48 49 50 |
# File 'lib/snapsync/btrfs_subvolume.rb', line 48 def creation_time @creation_time end |
#flags ⇒ String (readonly)
66 67 68 |
# File 'lib/snapsync/btrfs_subvolume.rb', line 66 def flags @flags end |
#gen_at_creation ⇒ Integer (readonly)
57 58 59 |
# File 'lib/snapsync/btrfs_subvolume.rb', line 57 def gen_at_creation @gen_at_creation end |
#generation ⇒ Integer (readonly)
54 55 56 |
# File 'lib/snapsync/btrfs_subvolume.rb', line 54 def generation @generation end |
#name ⇒ String (readonly)
33 34 35 |
# File 'lib/snapsync/btrfs_subvolume.rb', line 33 def name @name end |
#parent_id ⇒ Integer (readonly)
60 61 62 |
# File 'lib/snapsync/btrfs_subvolume.rb', line 60 def parent_id @parent_id end |
#parent_uuid ⇒ String (readonly)
Denotes a subvolume that’s a direct parent in the snapshot’s timeline. I.e. [parent -> self] difference possible
41 42 43 |
# File 'lib/snapsync/btrfs_subvolume.rb', line 41 def parent_uuid @parent_uuid end |
#receive_time ⇒ String (readonly)
83 84 85 |
# File 'lib/snapsync/btrfs_subvolume.rb', line 83 def receive_time @receive_time end |
#receive_transid ⇒ Integer (readonly)
The transaction of id of the start of the receive. The next transaction_id holds actual data and changes. It is +1 of the subvolume’s, created by btrfs receive, gen_at_creation
80 81 82 |
# File 'lib/snapsync/btrfs_subvolume.rb', line 80 def receive_transid @receive_transid end |
#received_uuid ⇒ String (readonly)
Denotes the UUID of the subvolume sent by ‘btrfs send’
45 46 47 |
# File 'lib/snapsync/btrfs_subvolume.rb', line 45 def received_uuid @received_uuid end |
#send_time ⇒ String (readonly)
74 75 76 |
# File 'lib/snapsync/btrfs_subvolume.rb', line 74 def send_time @send_time end |
#send_transid ⇒ Integer (readonly)
A transaction id in the sending btrfs filesystem for the ‘btrfs send` action. Does not correspond to anything in subvolumes.
71 72 73 |
# File 'lib/snapsync/btrfs_subvolume.rb', line 71 def send_transid @send_transid end |
#snapshots ⇒ Array<String> (readonly)
86 87 88 |
# File 'lib/snapsync/btrfs_subvolume.rb', line 86 def snapshots @snapshots end |
#subvolume_dir ⇒ AgnosticPath (readonly)
26 27 28 |
# File 'lib/snapsync/btrfs_subvolume.rb', line 26 def subvolume_dir @subvolume_dir end |
#subvolume_id ⇒ Integer (readonly)
51 52 53 |
# File 'lib/snapsync/btrfs_subvolume.rb', line 51 def subvolume_id @subvolume_id end |
#top_level_id ⇒ Integer (readonly)
63 64 65 |
# File 'lib/snapsync/btrfs_subvolume.rb', line 63 def top_level_id @top_level_id end |
#uuid ⇒ String (readonly)
36 37 38 |
# File 'lib/snapsync/btrfs_subvolume.rb', line 36 def uuid @uuid end |