bup 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -2
- data/Gemfile.lock +1 -1
- data/buprc +3 -2
- data/exe/bup +14 -5
- data/lib/bup/tar.rb +20 -7
- data/lib/bup/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 02ca6df7a29ad6290ab682bd214dc097c70e6a7a464bbbea22b1b4d100465ec7
|
4
|
+
data.tar.gz: 7bf6a98055fed3353f131e56033c876860ec6f4e22b995c4f002ffedd5e8462b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f96824b5eaa8fa4089497aa3eff4daf4abf5f041931fac622ac0163aed57d79036cced77b50a771fb5c675b6abaa1473e1018b9312c8e8d5935d12fc6255c601
|
7
|
+
data.tar.gz: 31aaf6faab04f3e7806bc60b082aac8bd0177aa4ade5fb40e02189289e75fef8d401aaedfce4f4abd4454aeb6679c881af0391dc732169d6eb362a820c970c9a
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,11 @@
|
|
1
1
|
## [Unreleased]
|
2
2
|
|
3
|
-
|
3
|
+
- List profiles.
|
4
|
+
- Bug fixes against empty backup directories.
|
5
|
+
- Bug fix to print buffers using read_nonblock from popen3 streams.
|
4
6
|
|
5
|
-
-
|
7
|
+
## [0.1.0] - 2021-11-11
|
8
|
+
|
9
|
+
- Backup profiles.
|
10
|
+
- Backup history limits.
|
11
|
+
- Tar command specification.
|
data/Gemfile.lock
CHANGED
data/buprc
CHANGED
@@ -1,14 +1,15 @@
|
|
1
1
|
---
|
2
2
|
profiles:
|
3
3
|
default:
|
4
|
+
description: "Simple backup of critical files."
|
4
5
|
include:
|
5
6
|
- "$HOME"
|
6
7
|
exclude:
|
7
8
|
- "$HOME"
|
8
9
|
- "$HOME/backups"
|
9
|
-
lastrun: '2021-11-
|
10
|
+
lastrun: '2021-11-11T18:45:33 +0000'
|
10
11
|
destination: "$HOME/backups"
|
11
|
-
history:
|
12
|
+
history: 2
|
12
13
|
tarcmd:
|
13
14
|
- sudo
|
14
15
|
- tar
|
data/exe/bup
CHANGED
@@ -21,12 +21,21 @@ OptParse.new do |opt|
|
|
21
21
|
opt.on("-t", "--type=type", String, "Type of backup.") do |t|
|
22
22
|
config.runtime["type"] = t == "incremental" ? t : "full"
|
23
23
|
end
|
24
|
+
|
25
|
+
opt.on("-l", "--list", "List profiles and exit.") do
|
26
|
+
config.runtime['action'] = 'list'
|
27
|
+
end
|
24
28
|
end.parse!
|
25
29
|
|
26
30
|
config.load(configfile) if File.exist?(configfile)
|
27
31
|
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
32
|
+
case config.runtime["action"]
|
33
|
+
when "list"
|
34
|
+
config.config["profiles"].each do |key, profile|
|
35
|
+
puts "#{key} - #{profile["description"] || ""}"
|
36
|
+
end
|
37
|
+
else
|
38
|
+
tar = Bup::Tar.new(config)
|
39
|
+
tar.call
|
40
|
+
config.save(configfile)
|
41
|
+
end
|
data/lib/bup/tar.rb
CHANGED
@@ -62,9 +62,11 @@ module Bup
|
|
62
62
|
end
|
63
63
|
|
64
64
|
# Remove all incremental files that are older than the oldest kept full backup.
|
65
|
-
|
66
|
-
|
67
|
-
|
65
|
+
if oldest_kept_file
|
66
|
+
remove_before = File.stat(oldest_kept_file).ctime
|
67
|
+
Dir["#{destination}/#{profile_name}*"].each do |backupfile|
|
68
|
+
File.delete(backupfile) if File.stat(backupfile).ctime < remove_before
|
69
|
+
end
|
68
70
|
end
|
69
71
|
end
|
70
72
|
|
@@ -101,17 +103,28 @@ module Bup
|
|
101
103
|
begin
|
102
104
|
Open3.popen3(*args) do |stdin, stdout, stderr, wait_thr|
|
103
105
|
stdin.close
|
104
|
-
|
105
106
|
while wait_thr.status
|
106
107
|
r, w, e = IO.select([stdout, stderr])
|
107
108
|
r.each do |stream|
|
108
|
-
|
109
|
+
begin
|
110
|
+
print stream.read_nonblock(1024)
|
111
|
+
rescue EOFError
|
112
|
+
end
|
109
113
|
end
|
110
114
|
end
|
111
115
|
|
112
116
|
wait_thr.join
|
113
|
-
|
114
|
-
|
117
|
+
begin
|
118
|
+
print stdout.read_nonblock(1024)
|
119
|
+
rescue EOFError
|
120
|
+
end
|
121
|
+
|
122
|
+
begin
|
123
|
+
print stderr.read_nonblock(1024)
|
124
|
+
rescue EOFError
|
125
|
+
end
|
126
|
+
|
127
|
+
STDOUT.flush
|
115
128
|
end
|
116
129
|
ensure
|
117
130
|
tf.unlink
|
data/lib/bup/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bup
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sam Baskinger
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-11-
|
11
|
+
date: 2021-11-14 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Backup tool driver that connects tar, gnupg, and other tools to accomplish
|
14
14
|
backups.
|