prlbackup 1.0.3 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +5 -1
- data/features/logging.feature +13 -6
- data/lib/prlbackup/cli.rb +2 -2
- data/lib/prlbackup/version.rb +1 -1
- data/lib/prlbackup/virtual_machine.rb +0 -1
- data/lib/prlbackup.rb +3 -1
- data/man/prlbackup.1 +5 -5
- data/man/prlbackup.1.html +7 -6
- data/man/prlbackup.1.ronn +6 -5
- data/spec/prlbackup_spec.rb +34 -59
- metadata +27 -29
- data/man/prlbackup +0 -31
- data/man/prlbackup.html +0 -253
data/README.md
CHANGED
@@ -6,12 +6,16 @@ an awesome backup tool for Parallels Server Virtual Machines
|
|
6
6
|
Installation
|
7
7
|
------------
|
8
8
|
|
9
|
+
Install it via [RubyGems](https://rubygems.org/gems/prlbackup):
|
10
|
+
|
9
11
|
gem install prlbackup
|
10
12
|
|
11
13
|
Usage
|
12
14
|
-----
|
13
15
|
|
14
|
-
Take a look at [
|
16
|
+
Take a look at [prlbackup(1)](http://bjoernalbers.de/prlbackup/):
|
17
|
+
|
18
|
+
gem man prlbackup
|
15
19
|
|
16
20
|
Note on Patches/Pull Requests
|
17
21
|
-----------------------------
|
data/features/logging.feature
CHANGED
@@ -13,8 +13,7 @@ Feature: Logging
|
|
13
13
|
|
14
14
|
Scenario: Log the last stdout line from prlctl
|
15
15
|
When I successfully run `prlbackup "Windows XP"`
|
16
|
-
|
17
|
-
And the stdout should contain "The VM has been successfully stopped"
|
16
|
+
Then the stdout should contain "The VM has been successfully stopped"
|
18
17
|
And the stdout should contain "The virtual machine has been successfully backed up with backup id"
|
19
18
|
And the stdout should contain "The VM has been successfully started"
|
20
19
|
|
@@ -32,8 +31,16 @@ Feature: Logging
|
|
32
31
|
When I run `prlbackup Ubuntu`
|
33
32
|
Then the output should match /ERROR.+BOOOOM/
|
34
33
|
|
35
|
-
Scenario:
|
34
|
+
Scenario: Display commands with option --verbose
|
36
35
|
When I run `prlbackup --verbose "Windows XP"`
|
37
|
-
Then the stdout should contain "
|
38
|
-
And the stdout should contain "
|
39
|
-
And the stdout should contain "
|
36
|
+
Then the stdout should contain "prlctl list --info"
|
37
|
+
And the stdout should contain "prlctl stop"
|
38
|
+
And the stdout should contain "prlctl backup"
|
39
|
+
And the stdout should contain "prlctl start"
|
40
|
+
|
41
|
+
Scenario: Display commands with VM impact with option --dry-run
|
42
|
+
When I run `prlbackup --dry-run "Windows XP"`
|
43
|
+
Then the stdout should contain "prlctl stop"
|
44
|
+
And the stdout should contain "prlctl backup"
|
45
|
+
And the stdout should contain "prlctl start"
|
46
|
+
But the stdout should not contain "prlctl list"
|
data/lib/prlbackup/cli.rb
CHANGED
@@ -19,7 +19,7 @@ module PrlBackup
|
|
19
19
|
option :verbose,
|
20
20
|
:long => '--verbose',
|
21
21
|
:short => '-v',
|
22
|
-
:description => '
|
22
|
+
:description => 'Display commands before executing them.',
|
23
23
|
:boolean => 'true',
|
24
24
|
:default => false
|
25
25
|
|
@@ -33,7 +33,7 @@ module PrlBackup
|
|
33
33
|
option :dry_run,
|
34
34
|
:long => '--dry-run',
|
35
35
|
:short => '-n',
|
36
|
-
:description => '
|
36
|
+
:description => 'Don\'t run commands with an impact on VMs (display them instead).',
|
37
37
|
:boolean => true,
|
38
38
|
:default => false
|
39
39
|
|
data/lib/prlbackup/version.rb
CHANGED
data/lib/prlbackup.rb
CHANGED
@@ -14,12 +14,12 @@ module PrlBackup
|
|
14
14
|
# Run the command and log the last line from stdout unless --dry-run.
|
15
15
|
# @return [String] stdout of the comand.
|
16
16
|
def command!(*args)
|
17
|
-
logger.info("Running `#{args.shelljoin}`...") if PrlBackup.config[:verbose]
|
18
17
|
unless PrlBackup.config[:dry_run]
|
19
18
|
output = command(*args)
|
20
19
|
logger.info(output.split("\n").last)
|
21
20
|
else
|
22
21
|
output = ''
|
22
|
+
logger.info("Dry-running `#{args.shelljoin}`...")
|
23
23
|
end
|
24
24
|
output
|
25
25
|
end
|
@@ -28,6 +28,7 @@ module PrlBackup
|
|
28
28
|
# @Note This will even run when option --dry-run is selected!
|
29
29
|
# @return [String] stdout of the comand.
|
30
30
|
def command(*args)
|
31
|
+
logger.info("Running `#{args.shelljoin}`...") if PrlBackup.config[:verbose]
|
31
32
|
output = `#{args.shelljoin} 2>&1`
|
32
33
|
status = $?
|
33
34
|
unless status.success?
|
@@ -44,6 +45,7 @@ module PrlBackup
|
|
44
45
|
private
|
45
46
|
|
46
47
|
def create_logger
|
48
|
+
STDOUT.sync = true
|
47
49
|
l = Logger.new(STDOUT)
|
48
50
|
l.formatter = proc { |severity, datetime, progname, msg| "prlbackup #{severity}: [#{self}] #{msg}\n" }
|
49
51
|
l
|
data/man/prlbackup.1
CHANGED
@@ -44,11 +44,11 @@ Create full backups (by default incremental backups are created)\. Note that the
|
|
44
44
|
.
|
45
45
|
.TP
|
46
46
|
\fB\-v\fR, \fB\-\-verbose\fR
|
47
|
-
|
47
|
+
Display commands before executing them\.
|
48
48
|
.
|
49
49
|
.TP
|
50
50
|
\fB\-n\fR, \fB\-\-dry\-run\fR
|
51
|
-
Don\'t
|
51
|
+
Don\'t run commands with an impact on VMs (display them instead)\.
|
52
52
|
.
|
53
53
|
.TP
|
54
54
|
\fB\-k\fR \fInumber_of_full_backups\fR, \fB\-\-keep\-only\fR \fInumber_of_full_backups\fR
|
@@ -120,13 +120,13 @@ $ prlbackup \-\-all \-\-exclude Delta Echo
|
|
120
120
|
.IP "" 0
|
121
121
|
.
|
122
122
|
.P
|
123
|
-
Show
|
123
|
+
Show what commands (with VM impact) whould have been run when backing up all VMs:
|
124
124
|
.
|
125
125
|
.IP "" 4
|
126
126
|
.
|
127
127
|
.nf
|
128
128
|
|
129
|
-
$ prlbackup \-\-dry\-run \-\-
|
129
|
+
$ prlbackup \-\-dry\-run \-\-all
|
130
130
|
.
|
131
131
|
.fi
|
132
132
|
.
|
@@ -151,7 +151,7 @@ $ prlbackup \-\-all \-\-keep\-only 5
|
|
151
151
|
prlctl(8)
|
152
152
|
.
|
153
153
|
.IP "\(bu" 4
|
154
|
-
prlbackup
|
154
|
+
prlbackup on Github \fIhttps://github\.com/bjoernalbers/prlbackup\fR
|
155
155
|
.
|
156
156
|
.IP "" 0
|
157
157
|
.
|
data/man/prlbackup.1.html
CHANGED
@@ -105,8 +105,8 @@ combination with option <code>--all</code>!).</p></dd>
|
|
105
105
|
<dt><code>-f</code>, <code>--full</code></dt><dd><p>Create full backups (by default incremental backups are created).
|
106
106
|
Note that the first backup for a VM is always a full backup despide
|
107
107
|
of this option.</p></dd>
|
108
|
-
<dt><code>-v</code>, <code>--verbose</code></dt><dd><p>
|
109
|
-
<dt><code>-n</code>, <code>--dry-run</code></dt><dd><p>Don't
|
108
|
+
<dt><code>-v</code>, <code>--verbose</code></dt><dd><p>Display commands before executing them.</p></dd>
|
109
|
+
<dt><code>-n</code>, <code>--dry-run</code></dt><dd><p>Don't run commands with an impact on VMs (display them instead).</p></dd>
|
110
110
|
<dt><code>-k</code> <var>number_of_full_backups</var>, <code>--keep-only</code> <var>number_of_full_backups</var></dt><dd><p>Delete the oldest full backup(s) until only <var>number_of_full_backups</var> exist.
|
111
111
|
This cleanup action will be executed for each VM right after creating the
|
112
112
|
corresponding backup but only if the backup was successfully created.
|
@@ -142,9 +142,10 @@ full backup is deleted.</p></dd>
|
|
142
142
|
<pre><code>$ prlbackup --all --exclude Delta Echo
|
143
143
|
</code></pre>
|
144
144
|
|
145
|
-
<p>Show
|
145
|
+
<p>Show what commands (with VM impact) whould have been run when backing up
|
146
|
+
all VMs:</p>
|
146
147
|
|
147
|
-
<pre><code>$ prlbackup --dry-run --
|
148
|
+
<pre><code>$ prlbackup --dry-run --all
|
148
149
|
</code></pre>
|
149
150
|
|
150
151
|
<p>Create the weekly full backup for all VMs and delete backups older than four weeks:</p>
|
@@ -156,13 +157,13 @@ full backup is deleted.</p></dd>
|
|
156
157
|
|
157
158
|
<ul>
|
158
159
|
<li><span class="man-ref">prlctl<span class="s">(8)</span></span></li>
|
159
|
-
<li><a href="https://github.com/bjoernalbers/prlbackup">prlbackup
|
160
|
+
<li><a href="https://github.com/bjoernalbers/prlbackup">prlbackup on Github</a></li>
|
160
161
|
</ul>
|
161
162
|
|
162
163
|
|
163
164
|
<h2 id="COPYRIGHT">COPYRIGHT</h2>
|
164
165
|
|
165
|
-
<p>Copyright (c) 2012 Bjoern Albers (<a href="&#
|
166
|
+
<p>Copyright (c) 2012 Bjoern Albers (<a href="mailto:bjoernalbers@googlemail.com" data-bare-link="true">bjoernalbers@googlemail.com</a>)</p>
|
166
167
|
|
167
168
|
<p>Permission is hereby granted, free of charge, to any person obtaining
|
168
169
|
a copy of this software and associated documentation files (the
|
data/man/prlbackup.1.ronn
CHANGED
@@ -35,10 +35,10 @@ Server is required.
|
|
35
35
|
of this option.
|
36
36
|
|
37
37
|
* `-v`, `--verbose`:
|
38
|
-
|
38
|
+
Display commands before executing them.
|
39
39
|
|
40
40
|
* `-n`, `--dry-run`:
|
41
|
-
Don't
|
41
|
+
Don't run commands with an impact on VMs (display them instead).
|
42
42
|
|
43
43
|
* `-k` <number_of_full_backups>, `--keep-only` <number_of_full_backups>:
|
44
44
|
Delete the oldest full backup(s) until only <number_of_full_backups> exist.
|
@@ -69,9 +69,10 @@ Backup all but not the given VMs:
|
|
69
69
|
|
70
70
|
$ prlbackup --all --exclude Delta Echo
|
71
71
|
|
72
|
-
Show
|
72
|
+
Show what commands (with VM impact) whould have been run when backing up
|
73
|
+
all VMs:
|
73
74
|
|
74
|
-
$ prlbackup --dry-run --
|
75
|
+
$ prlbackup --dry-run --all
|
75
76
|
|
76
77
|
Create the weekly full backup for all VMs and delete backups older than four weeks:
|
77
78
|
|
@@ -80,7 +81,7 @@ Create the weekly full backup for all VMs and delete backups older than four wee
|
|
80
81
|
## SEE ALSO
|
81
82
|
|
82
83
|
* prlctl(8)
|
83
|
-
* [prlbackup
|
84
|
+
* [prlbackup on Github](https://github.com/bjoernalbers/prlbackup)
|
84
85
|
|
85
86
|
## COPYRIGHT
|
86
87
|
|
data/spec/prlbackup_spec.rb
CHANGED
@@ -47,69 +47,14 @@ module PrlBackup
|
|
47
47
|
it 'should return a blank string' do
|
48
48
|
@foo.command!.should eql('')
|
49
49
|
end
|
50
|
-
end
|
51
50
|
|
52
|
-
|
53
|
-
|
54
|
-
PrlBackup.stub(:config).and_return({:dry_run => true, :verbose => true})
|
55
|
-
end
|
56
|
-
|
57
|
-
it 'should log which command would be running' do
|
58
|
-
@foo.logger.should_receive(:info).with('Running `some command`...')
|
51
|
+
it 'should log the command which would be performed' do
|
52
|
+
@foo.logger.should_receive(:info).with('Dry-running `some command`...')
|
59
53
|
@foo.command!('some', 'command')
|
60
54
|
end
|
61
55
|
end
|
62
56
|
end
|
63
57
|
|
64
|
-
# describe '#command' do
|
65
|
-
# before do
|
66
|
-
# @foo = Foo.new
|
67
|
-
# @pid = double('pid')
|
68
|
-
# @stdin = double('stdin')
|
69
|
-
# @stdout = double('stdout', :read => "")
|
70
|
-
# @stderr = double('stderr')
|
71
|
-
# @status = double('status')
|
72
|
-
# @status.stub(:success?).and_return(true)
|
73
|
-
# @popen4_return = [@pid, @stdin, @stdout, @stderr]
|
74
|
-
# @waitpid2_return = [nil, @status]
|
75
|
-
# Open4.stub(:popen4).and_return(@popen4_return)
|
76
|
-
# Process.stub(:waitpid2).and_return(@waitpid2_return)
|
77
|
-
# PrlBackup.stub(:config).and_return({:verbose => false})
|
78
|
-
# end
|
79
|
-
#
|
80
|
-
# it 'should run a command and wait for it' do
|
81
|
-
# Open4.should_receive(:popen4).with('hello', 'world').and_return(@popen4_return)
|
82
|
-
# Process::should_receive(:waitpid2).with(@pid).and_return(@waitpid2_return)
|
83
|
-
# @foo.command('hello', 'world')
|
84
|
-
# end
|
85
|
-
#
|
86
|
-
# it 'should read and return the stdout' do
|
87
|
-
# @stdout.stub(:read).and_return('hello')
|
88
|
-
# @foo.command("ruby -e 'puts %q{hello}'").should eql('hello')
|
89
|
-
# end
|
90
|
-
#
|
91
|
-
# context 'with a failing command' do
|
92
|
-
# before do
|
93
|
-
# @foo.stub(:exit)
|
94
|
-
# @foo.stub_chain(:logger, :error)
|
95
|
-
# @status.stub(:success?).and_return(false)
|
96
|
-
# @stdout.stub(:read).and_return('stdout')
|
97
|
-
# @stderr.stub(:read).and_return('stderr')
|
98
|
-
# @status.stub(:exitstatus).and_return(42)
|
99
|
-
# end
|
100
|
-
#
|
101
|
-
# it 'should log failing commands' do
|
102
|
-
# @foo.logger.should_receive(:error).with("Command `some command` failed with exit status 42:\nstdoutstderr")
|
103
|
-
# output = @foo.command('some', 'command')
|
104
|
-
# end
|
105
|
-
#
|
106
|
-
# it 'should exit immediately' do
|
107
|
-
# @foo.should_receive(:exit).with(1)
|
108
|
-
# @foo.command('some', 'command')
|
109
|
-
# end
|
110
|
-
# end
|
111
|
-
# end
|
112
|
-
|
113
58
|
describe '#logger' do
|
114
59
|
before do
|
115
60
|
@logger = double('logger')
|
@@ -118,9 +63,39 @@ module PrlBackup
|
|
118
63
|
@foo = Foo.new
|
119
64
|
end
|
120
65
|
|
121
|
-
it 'should initialize a new logger' do
|
122
|
-
Logger.should_receive(:new).with(STDOUT)
|
66
|
+
it 'should initialize a new logger once' do
|
67
|
+
Logger.should_receive(:new).once.with(STDOUT)
|
68
|
+
2.times { @foo.logger }
|
69
|
+
end
|
70
|
+
|
71
|
+
it 'should return the logger' do
|
72
|
+
@foo.logger.should eql(@logger)
|
73
|
+
end
|
74
|
+
|
75
|
+
it 'should flush to stdout' do
|
76
|
+
original_sync_state = STDOUT.sync
|
77
|
+
STDOUT.sync = false
|
78
|
+
STDOUT.sync.should be_false
|
123
79
|
@foo.logger
|
80
|
+
STDOUT.sync.should be_true
|
81
|
+
STDOUT.sync = original_sync_state
|
82
|
+
end
|
83
|
+
end
|
84
|
+
|
85
|
+
describe '#command' do
|
86
|
+
context 'with option --verbose' do
|
87
|
+
before do
|
88
|
+
@foo = Foo.new
|
89
|
+
@foo.stub(:`).and_return('')
|
90
|
+
@logger = double('logger')
|
91
|
+
@foo.stub(:logger).and_return(@logger)
|
92
|
+
PrlBackup.stub(:config).and_return({:verbose => true})
|
93
|
+
end
|
94
|
+
|
95
|
+
it 'should log which command would be running' do
|
96
|
+
@foo.logger.should_receive(:info).with('Running `some command`...')
|
97
|
+
@foo.command('some', 'command')
|
98
|
+
end
|
124
99
|
end
|
125
100
|
end
|
126
101
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: prlbackup
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0
|
4
|
+
version: 1.1.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-05-
|
12
|
+
date: 2012-05-02 00:00:00.000000000Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: mixlib-cli
|
16
|
-
requirement: &
|
16
|
+
requirement: &70123478474040 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: 1.2.0
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70123478474040
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: gem-man
|
27
|
-
requirement: &
|
27
|
+
requirement: &70123478472680 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ~>
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: 0.3.0
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *70123478472680
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: cucumber
|
38
|
-
requirement: &
|
38
|
+
requirement: &70123478471480 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ! '>='
|
@@ -43,10 +43,10 @@ dependencies:
|
|
43
43
|
version: 1.1.4
|
44
44
|
type: :development
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *70123478471480
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: aruba
|
49
|
-
requirement: &
|
49
|
+
requirement: &70123478469480 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
52
|
- - ! '>='
|
@@ -54,10 +54,10 @@ dependencies:
|
|
54
54
|
version: 0.4.11
|
55
55
|
type: :development
|
56
56
|
prerelease: false
|
57
|
-
version_requirements: *
|
57
|
+
version_requirements: *70123478469480
|
58
58
|
- !ruby/object:Gem::Dependency
|
59
59
|
name: aruba-doubles
|
60
|
-
requirement: &
|
60
|
+
requirement: &70123478468460 !ruby/object:Gem::Requirement
|
61
61
|
none: false
|
62
62
|
requirements:
|
63
63
|
- - ~>
|
@@ -65,10 +65,10 @@ dependencies:
|
|
65
65
|
version: 1.2.1
|
66
66
|
type: :development
|
67
67
|
prerelease: false
|
68
|
-
version_requirements: *
|
68
|
+
version_requirements: *70123478468460
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: guard-cucumber
|
71
|
-
requirement: &
|
71
|
+
requirement: &70123478467760 !ruby/object:Gem::Requirement
|
72
72
|
none: false
|
73
73
|
requirements:
|
74
74
|
- - ! '>='
|
@@ -76,10 +76,10 @@ dependencies:
|
|
76
76
|
version: 0.7.5
|
77
77
|
type: :development
|
78
78
|
prerelease: false
|
79
|
-
version_requirements: *
|
79
|
+
version_requirements: *70123478467760
|
80
80
|
- !ruby/object:Gem::Dependency
|
81
81
|
name: guard-rspec
|
82
|
-
requirement: &
|
82
|
+
requirement: &70123478466680 !ruby/object:Gem::Requirement
|
83
83
|
none: false
|
84
84
|
requirements:
|
85
85
|
- - ! '>='
|
@@ -87,10 +87,10 @@ dependencies:
|
|
87
87
|
version: 0.5.1
|
88
88
|
type: :development
|
89
89
|
prerelease: false
|
90
|
-
version_requirements: *
|
90
|
+
version_requirements: *70123478466680
|
91
91
|
- !ruby/object:Gem::Dependency
|
92
92
|
name: guard-ronn
|
93
|
-
requirement: &
|
93
|
+
requirement: &70123478465940 !ruby/object:Gem::Requirement
|
94
94
|
none: false
|
95
95
|
requirements:
|
96
96
|
- - ! '>='
|
@@ -98,10 +98,10 @@ dependencies:
|
|
98
98
|
version: 0.1.2
|
99
99
|
type: :development
|
100
100
|
prerelease: false
|
101
|
-
version_requirements: *
|
101
|
+
version_requirements: *70123478465940
|
102
102
|
- !ruby/object:Gem::Dependency
|
103
103
|
name: ronn
|
104
|
-
requirement: &
|
104
|
+
requirement: &70123478465020 !ruby/object:Gem::Requirement
|
105
105
|
none: false
|
106
106
|
requirements:
|
107
107
|
- - ! '>='
|
@@ -109,10 +109,10 @@ dependencies:
|
|
109
109
|
version: 0.7.3
|
110
110
|
type: :development
|
111
111
|
prerelease: false
|
112
|
-
version_requirements: *
|
112
|
+
version_requirements: *70123478465020
|
113
113
|
- !ruby/object:Gem::Dependency
|
114
114
|
name: rake
|
115
|
-
requirement: &
|
115
|
+
requirement: &70123478464220 !ruby/object:Gem::Requirement
|
116
116
|
none: false
|
117
117
|
requirements:
|
118
118
|
- - ! '>='
|
@@ -120,10 +120,10 @@ dependencies:
|
|
120
120
|
version: '0'
|
121
121
|
type: :development
|
122
122
|
prerelease: false
|
123
|
-
version_requirements: *
|
123
|
+
version_requirements: *70123478464220
|
124
124
|
- !ruby/object:Gem::Dependency
|
125
125
|
name: rb-fsevent
|
126
|
-
requirement: &
|
126
|
+
requirement: &70123478463360 !ruby/object:Gem::Requirement
|
127
127
|
none: false
|
128
128
|
requirements:
|
129
129
|
- - ! '>='
|
@@ -131,7 +131,7 @@ dependencies:
|
|
131
131
|
version: 0.9.0
|
132
132
|
type: :development
|
133
133
|
prerelease: false
|
134
|
-
version_requirements: *
|
134
|
+
version_requirements: *70123478463360
|
135
135
|
description: an awesome backup tool for Parallels Server Virtual Machines
|
136
136
|
email:
|
137
137
|
- bjoernalbers@googlemail.com
|
@@ -156,11 +156,9 @@ files:
|
|
156
156
|
- lib/prlbackup/cli.rb
|
157
157
|
- lib/prlbackup/version.rb
|
158
158
|
- lib/prlbackup/virtual_machine.rb
|
159
|
-
- man/prlbackup
|
160
159
|
- man/prlbackup.1
|
161
160
|
- man/prlbackup.1.html
|
162
161
|
- man/prlbackup.1.ronn
|
163
|
-
- man/prlbackup.html
|
164
162
|
- prlbackup.gemspec
|
165
163
|
- spec/prlbackup/cli_spec.rb
|
166
164
|
- spec/prlbackup/virtual_machine_spec.rb
|
@@ -180,7 +178,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
180
178
|
version: '0'
|
181
179
|
segments:
|
182
180
|
- 0
|
183
|
-
hash:
|
181
|
+
hash: 4134583488941249092
|
184
182
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
185
183
|
none: false
|
186
184
|
requirements:
|
@@ -189,13 +187,13 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
189
187
|
version: '0'
|
190
188
|
segments:
|
191
189
|
- 0
|
192
|
-
hash:
|
190
|
+
hash: 4134583488941249092
|
193
191
|
requirements: []
|
194
192
|
rubyforge_project:
|
195
193
|
rubygems_version: 1.8.10
|
196
194
|
signing_key:
|
197
195
|
specification_version: 3
|
198
|
-
summary: prlbackup-1.0
|
196
|
+
summary: prlbackup-1.1.0
|
199
197
|
test_files:
|
200
198
|
- features/cleanup.feature
|
201
199
|
- features/create_backups.feature
|
data/man/prlbackup
DELETED
@@ -1,31 +0,0 @@
|
|
1
|
-
.\" generated with Ronn/v0.7.3
|
2
|
-
.\" http://github.com/rtomayko/ronn/tree/0.7.3
|
3
|
-
.
|
4
|
-
.TH "PRLBACKUP" "" "May 2012" "" "PRLBACKUP MANUAL"
|
5
|
-
.
|
6
|
-
.SH "NAME"
|
7
|
-
\fBprlbackup\fR
|
8
|
-
.
|
9
|
-
.P
|
10
|
-
\&\.\e" generated with Ronn/v0\.7\.3 \.\e" http://github\.com/rtomayko/ronn/tree/0\.7\.3 \. \.TH "PRLBACKUP" "1" "May 2012" "" "PRLBACKUP MANUAL" \. \.SH "NAME" \efBprlbackup\efR \- an awesome backup tool for Parallels Server Virtual Machines \. \.SH "SYNOPSIS" \efBprlbackup\efR \efB\-h\efR|\efB\-\-help\efR \. \.br \efBprlbackup\efR [\efIOPTIONS\efR\.\.\.] \efIvm_id|vm_name\efR\.\.\. \. \.br \efBprlbackup\efR [\efIOPTIONS\efR\.\.\.] \efB\-a\efR|\efB\-\-all\efR \. \.br \efBprlbackup\efR [\efIOPTIONS\efR\.\.\.] \efB\-a\efR|\efB\-\-all\efR \efB\-e\efR|\efB\-\-exclude\efR \efIvm_id|vm_name\efR\.\.\. \. \.SH "DESCRIPTION" \efBprlbackup\efR simplifies the backup of one or multiple Virtual Machines (VM) running on Parallels Server by stoping them during backup and deleting old backups on demand\. A working installation of Parallels Server is required\. \. \.P \efBprlbackup\efR was tested under Parallels Server for Mac 4\.0 (PSfM)\. \. \.SH "OPTIONS" \. \.TP \efB\-h\efR, \efB\-\-help\efR Display a short help\. \. \.TP \efB\-a\efR, \efB\-\-all\efR Backup all virtual machines which are registered in Parallels Server\. \. \.TP \efB\-e\efR, \efB\-\-exclude\efR Backup all but the given virtual machines (only applicable in combination with option \efB\-\-all\efR!)\. \. \.TP \efB\-f\efR, \efB\-\-full\efR Create full backups (by default incremental backups are created)\. Note that the first backup for a VM is always a full backup despide of this option\. \. \.TP \efB\-v\efR, \efB\-\-verbose\efR Show commands with an impact on the VMs prior to their execution\. \. \.TP \efB\-n\efR, \efB\-\-dry\-run\efR Don\e\'t do anything with the VMs, just pretend to\. \. \.TP \efB\-k\efR \efInumber_of_full_backups\efR, \efB\-\-keep\-only\efR \efInumber_of_full_backups\efR Delete the oldest full backup(s) until only \efInumber_of_full_backups\efR exist\. This cleanup action will be executed for each VM right after creating the corresponding backup but only if the backup was successfully created\. Incremental backups are automatically deleted by Parallels Server when their full backup is deleted\. \. \.SH "EXAMPLES" Display short help: \. \.IP "" 4 \. \.nf
|
11
|
-
.
|
12
|
-
.P
|
13
|
-
$ prlbackup \-\-help \. \.fi \. \.IP "" 0 \. \.P Backup VMs by name: \. \.IP "" 4 \. \.nf
|
14
|
-
.
|
15
|
-
.P
|
16
|
-
$ prlbackup Alpha Bravo Charlie \. \.fi \. \.IP "" 0 \. \.P Backup a VM by id: \. \.IP "" 4 \. \.nf
|
17
|
-
.
|
18
|
-
.P
|
19
|
-
$ prlbackup "{97351580\-afd7\-4aff\-9960\-814196b28e37}" \. \.fi \. \.IP "" 0 \. \.P Create full backups of all VMs \. \.IP "" 4 \. \.nf
|
20
|
-
.
|
21
|
-
.P
|
22
|
-
$ prlbackup \-\-full \-\-all \. \.fi \. \.IP "" 0 \. \.P Backup all but not the given VMs: \. \.IP "" 4 \. \.nf
|
23
|
-
.
|
24
|
-
.P
|
25
|
-
$ prlbackup \-\-all \-\-exclude Delta Echo \. \.fi \. \.IP "" 0 \. \.P Show which commands would have been run when backing up all VMs: \. \.IP "" 4 \. \.nf
|
26
|
-
.
|
27
|
-
.P
|
28
|
-
$ prlbackup \-\-dry\-run \-\-verbose \-\-all \. \.fi \. \.IP "" 0 \. \.P Create the weekly full backup for all VMs and delete backups older than four weeks: \. \.IP "" 4 \. \.nf
|
29
|
-
.
|
30
|
-
.P
|
31
|
-
$ prlbackup \-\-all \-\-keep\-only 5 \. \.fi \. \.IP "" 0 \. \.SH "SEE ALSO" \. \.IP "(bu" 4 prlctl(8) \. \.IP "(bu" 4 prlbackup\e\'s homepage \efIhttps://github\.com/bjoernalbers/prlbackup\efR \. \.IP "" 0 \. \.SH "COPYRIGHT" Copyright (c) 2012 Bjoern Albers (\efIbjoernalbers@googlemail\.com\efR) \. \.P Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: \. \.P The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software\. \. \.P THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT\. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE\.
|
data/man/prlbackup.html
DELETED
@@ -1,253 +0,0 @@
|
|
1
|
-
<!DOCTYPE html>
|
2
|
-
<html>
|
3
|
-
<head>
|
4
|
-
<meta http-equiv='content-type' value='text/html;charset=utf8'>
|
5
|
-
<meta name='generator' value='Ronn/v0.7.3 (http://github.com/rtomayko/ronn/tree/0.7.3)'>
|
6
|
-
<title>prlbackup</title>
|
7
|
-
<style type='text/css' media='all'>
|
8
|
-
/* style: man */
|
9
|
-
body#manpage {margin:0}
|
10
|
-
.mp {max-width:100ex;padding:0 9ex 1ex 4ex}
|
11
|
-
.mp p,.mp pre,.mp ul,.mp ol,.mp dl {margin:0 0 20px 0}
|
12
|
-
.mp h2 {margin:10px 0 0 0}
|
13
|
-
.mp > p,.mp > pre,.mp > ul,.mp > ol,.mp > dl {margin-left:8ex}
|
14
|
-
.mp h3 {margin:0 0 0 4ex}
|
15
|
-
.mp dt {margin:0;clear:left}
|
16
|
-
.mp dt.flush {float:left;width:8ex}
|
17
|
-
.mp dd {margin:0 0 0 9ex}
|
18
|
-
.mp h1,.mp h2,.mp h3,.mp h4 {clear:left}
|
19
|
-
.mp pre {margin-bottom:20px}
|
20
|
-
.mp pre+h2,.mp pre+h3 {margin-top:22px}
|
21
|
-
.mp h2+pre,.mp h3+pre {margin-top:5px}
|
22
|
-
.mp img {display:block;margin:auto}
|
23
|
-
.mp h1.man-title {display:none}
|
24
|
-
.mp,.mp code,.mp pre,.mp tt,.mp kbd,.mp samp,.mp h3,.mp h4 {font-family:monospace;font-size:14px;line-height:1.42857142857143}
|
25
|
-
.mp h2 {font-size:16px;line-height:1.25}
|
26
|
-
.mp h1 {font-size:20px;line-height:2}
|
27
|
-
.mp {text-align:justify;background:#fff}
|
28
|
-
.mp,.mp code,.mp pre,.mp pre code,.mp tt,.mp kbd,.mp samp {color:#131211}
|
29
|
-
.mp h1,.mp h2,.mp h3,.mp h4 {color:#030201}
|
30
|
-
.mp u {text-decoration:underline}
|
31
|
-
.mp code,.mp strong,.mp b {font-weight:bold;color:#131211}
|
32
|
-
.mp em,.mp var {font-style:italic;color:#232221;text-decoration:none}
|
33
|
-
.mp a,.mp a:link,.mp a:hover,.mp a code,.mp a pre,.mp a tt,.mp a kbd,.mp a samp {color:#0000ff}
|
34
|
-
.mp b.man-ref {font-weight:normal;color:#434241}
|
35
|
-
.mp pre {padding:0 4ex}
|
36
|
-
.mp pre code {font-weight:normal;color:#434241}
|
37
|
-
.mp h2+pre,h3+pre {padding-left:0}
|
38
|
-
ol.man-decor,ol.man-decor li {margin:3px 0 10px 0;padding:0;float:left;width:33%;list-style-type:none;text-transform:uppercase;color:#999;letter-spacing:1px}
|
39
|
-
ol.man-decor {width:100%}
|
40
|
-
ol.man-decor li.tl {text-align:left}
|
41
|
-
ol.man-decor li.tc {text-align:center;letter-spacing:4px}
|
42
|
-
ol.man-decor li.tr {text-align:right;float:right}
|
43
|
-
</style>
|
44
|
-
<style type='text/css' media='all'>
|
45
|
-
/* style: toc */
|
46
|
-
.man-navigation {display:block !important;position:fixed;top:0;left:113ex;height:100%;width:100%;padding:48px 0 0 0;border-left:1px solid #dbdbdb;background:#eee}
|
47
|
-
.man-navigation a,.man-navigation a:hover,.man-navigation a:link,.man-navigation a:visited {display:block;margin:0;padding:5px 2px 5px 30px;color:#999;text-decoration:none}
|
48
|
-
.man-navigation a:hover {color:#111;text-decoration:underline}
|
49
|
-
</style>
|
50
|
-
</head>
|
51
|
-
<!--
|
52
|
-
The following styles are deprecated and will be removed at some point:
|
53
|
-
div#man, div#man ol.man, div#man ol.head, div#man ol.man.
|
54
|
-
|
55
|
-
The .man-page, .man-decor, .man-head, .man-foot, .man-title, and
|
56
|
-
.man-navigation should be used instead.
|
57
|
-
-->
|
58
|
-
<body id='manpage'>
|
59
|
-
<div class='mp' id='man'>
|
60
|
-
|
61
|
-
<div class='man-navigation' style='display:none'>
|
62
|
-
<a href="#NAME">NAME</a>
|
63
|
-
</div>
|
64
|
-
|
65
|
-
<ol class='man-decor man-head man head'>
|
66
|
-
<li class='tl'>prlbackup</li>
|
67
|
-
<li class='tc'>PRLBACKUP MANUAL</li>
|
68
|
-
<li class='tr'>prlbackup</li>
|
69
|
-
</ol>
|
70
|
-
|
71
|
-
<h2 id="NAME">NAME</h2>
|
72
|
-
<p class="man-name">
|
73
|
-
<code>prlbackup</code>
|
74
|
-
</p>
|
75
|
-
<p>.\" generated with Ronn/v0.7.3
|
76
|
-
.\" http://github.com/rtomayko/ronn/tree/0.7.3
|
77
|
-
.
|
78
|
-
.TH "PRLBACKUP" "1" "May 2012" "" "PRLBACKUP MANUAL"
|
79
|
-
.
|
80
|
-
.SH "NAME"
|
81
|
-
\fBprlbackup\fR - an awesome backup tool for Parallels Server Virtual Machines
|
82
|
-
.
|
83
|
-
.SH "SYNOPSIS"
|
84
|
-
\fBprlbackup\fR \fB-h\fR|\fB--help\fR
|
85
|
-
.
|
86
|
-
.br
|
87
|
-
\fBprlbackup\fR [\fIOPTIONS\fR...] \fIvm_id|vm_name\fR...
|
88
|
-
.
|
89
|
-
.br
|
90
|
-
\fBprlbackup\fR [\fIOPTIONS\fR...] \fB-a\fR|\fB--all\fR
|
91
|
-
.
|
92
|
-
.br
|
93
|
-
\fBprlbackup\fR [\fIOPTIONS\fR...] \fB-a\fR|\fB--all\fR \fB-e\fR|\fB--exclude\fR \fIvm_id|vm_name\fR...
|
94
|
-
.
|
95
|
-
.SH "DESCRIPTION"
|
96
|
-
\fBprlbackup\fR simplifies the backup of one or multiple Virtual Machines (VM) running on Parallels Server by stoping them during backup and deleting old backups on demand. A working installation of Parallels Server is required.
|
97
|
-
.
|
98
|
-
.P
|
99
|
-
\fBprlbackup\fR was tested under Parallels Server for Mac 4.0 (PSfM).
|
100
|
-
.
|
101
|
-
.SH "OPTIONS"
|
102
|
-
.
|
103
|
-
.TP
|
104
|
-
\fB-h\fR, \fB--help\fR
|
105
|
-
Display a short help.
|
106
|
-
.
|
107
|
-
.TP
|
108
|
-
\fB-a\fR, \fB--all\fR
|
109
|
-
Backup all virtual machines which are registered in Parallels Server.
|
110
|
-
.
|
111
|
-
.TP
|
112
|
-
\fB-e\fR, \fB--exclude\fR
|
113
|
-
Backup all but the given virtual machines (only applicable in combination with option \fB--all\fR!).
|
114
|
-
.
|
115
|
-
.TP
|
116
|
-
\fB-f\fR, \fB--full\fR
|
117
|
-
Create full backups (by default incremental backups are created). Note that the first backup for a VM is always a full backup despide of this option.
|
118
|
-
.
|
119
|
-
.TP
|
120
|
-
\fB-v\fR, \fB--verbose\fR
|
121
|
-
Show commands with an impact on the VMs prior to their execution.
|
122
|
-
.
|
123
|
-
.TP
|
124
|
-
\fB-n\fR, \fB--dry-run\fR
|
125
|
-
Don\'t do anything with the VMs, just pretend to.
|
126
|
-
.
|
127
|
-
.TP
|
128
|
-
\fB-k\fR \fInumber_of_full_backups\fR, \fB--keep-only\fR \fInumber_of_full_backups\fR
|
129
|
-
Delete the oldest full backup(s) until only \fInumber_of_full_backups\fR exist. This cleanup action will be executed for each VM right after creating the corresponding backup but only if the backup was successfully created. Incremental backups are automatically deleted by Parallels Server when their full backup is deleted.
|
130
|
-
.
|
131
|
-
.SH "EXAMPLES"
|
132
|
-
Display short help:
|
133
|
-
.
|
134
|
-
.IP "" 4
|
135
|
-
.
|
136
|
-
.nf</p>
|
137
|
-
|
138
|
-
<p>$ prlbackup --help
|
139
|
-
.
|
140
|
-
.fi
|
141
|
-
.
|
142
|
-
.IP "" 0
|
143
|
-
.
|
144
|
-
.P
|
145
|
-
Backup VMs by name:
|
146
|
-
.
|
147
|
-
.IP "" 4
|
148
|
-
.
|
149
|
-
.nf</p>
|
150
|
-
|
151
|
-
<p>$ prlbackup Alpha Bravo Charlie
|
152
|
-
.
|
153
|
-
.fi
|
154
|
-
.
|
155
|
-
.IP "" 0
|
156
|
-
.
|
157
|
-
.P
|
158
|
-
Backup a VM by id:
|
159
|
-
.
|
160
|
-
.IP "" 4
|
161
|
-
.
|
162
|
-
.nf</p>
|
163
|
-
|
164
|
-
<p>$ prlbackup "{97351580-afd7-4aff-9960-814196b28e37}"
|
165
|
-
.
|
166
|
-
.fi
|
167
|
-
.
|
168
|
-
.IP "" 0
|
169
|
-
.
|
170
|
-
.P
|
171
|
-
Create full backups of all VMs
|
172
|
-
.
|
173
|
-
.IP "" 4
|
174
|
-
.
|
175
|
-
.nf</p>
|
176
|
-
|
177
|
-
<p>$ prlbackup --full --all
|
178
|
-
.
|
179
|
-
.fi
|
180
|
-
.
|
181
|
-
.IP "" 0
|
182
|
-
.
|
183
|
-
.P
|
184
|
-
Backup all but not the given VMs:
|
185
|
-
.
|
186
|
-
.IP "" 4
|
187
|
-
.
|
188
|
-
.nf</p>
|
189
|
-
|
190
|
-
<p>$ prlbackup --all --exclude Delta Echo
|
191
|
-
.
|
192
|
-
.fi
|
193
|
-
.
|
194
|
-
.IP "" 0
|
195
|
-
.
|
196
|
-
.P
|
197
|
-
Show which commands would have been run when backing up all VMs:
|
198
|
-
.
|
199
|
-
.IP "" 4
|
200
|
-
.
|
201
|
-
.nf</p>
|
202
|
-
|
203
|
-
<p>$ prlbackup --dry-run --verbose --all
|
204
|
-
.
|
205
|
-
.fi
|
206
|
-
.
|
207
|
-
.IP "" 0
|
208
|
-
.
|
209
|
-
.P
|
210
|
-
Create the weekly full backup for all VMs and delete backups older than four weeks:
|
211
|
-
.
|
212
|
-
.IP "" 4
|
213
|
-
.
|
214
|
-
.nf</p>
|
215
|
-
|
216
|
-
<p>$ prlbackup --all --keep-only 5
|
217
|
-
.
|
218
|
-
.fi
|
219
|
-
.
|
220
|
-
.IP "" 0
|
221
|
-
.
|
222
|
-
.SH "SEE ALSO"
|
223
|
-
.
|
224
|
-
.IP "(bu" 4
|
225
|
-
<span class="man-ref">prlctl<span class="s">(8)</span></span>
|
226
|
-
.
|
227
|
-
.IP "(bu" 4
|
228
|
-
prlbackup\'s homepage \fIhttps://github.com/bjoernalbers/prlbackup\fR
|
229
|
-
.
|
230
|
-
.IP "" 0
|
231
|
-
.
|
232
|
-
.SH "COPYRIGHT"
|
233
|
-
Copyright (c) 2012 Bjoern Albers (\fIbjoernalbers@googlemail.com\fR)
|
234
|
-
.
|
235
|
-
.P
|
236
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
237
|
-
.
|
238
|
-
.P
|
239
|
-
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
240
|
-
.
|
241
|
-
.P
|
242
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.</p>
|
243
|
-
|
244
|
-
|
245
|
-
<ol class='man-decor man-foot man foot'>
|
246
|
-
<li class='tl'></li>
|
247
|
-
<li class='tc'>May 2012</li>
|
248
|
-
<li class='tr'>prlbackup</li>
|
249
|
-
</ol>
|
250
|
-
|
251
|
-
</div>
|
252
|
-
</body>
|
253
|
-
</html>
|