syc-backup 0.0.4
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.
- data/README.rdoc +48 -0
- data/Rakefile +7 -0
- data/bin/sycbackup +6 -0
- data/doc/Backup.html +186 -0
- data/doc/Backup/CronEdit.html +381 -0
- data/doc/Backup/Environment.html +231 -0
- data/doc/Backup/FileBackup.html +363 -0
- data/doc/Backup/MySQLBackup.html +305 -0
- data/doc/Backup/Options.html +328 -0
- data/doc/Backup/Process.html +261 -0
- data/doc/Backup/Runner.html +244 -0
- data/doc/README_rdoc.html +202 -0
- data/doc/Rakefile.html +118 -0
- data/doc/TestCronEdit.html +211 -0
- data/doc/TestEnvironment.html +156 -0
- data/doc/TestFileBackup.html +237 -0
- data/doc/TestMySQLBackup.html +167 -0
- data/doc/TestOptions.html +156 -0
- data/doc/TestProcess.html +236 -0
- data/doc/created.rid +18 -0
- data/doc/images/add.png +0 -0
- data/doc/images/brick.png +0 -0
- data/doc/images/brick_link.png +0 -0
- data/doc/images/bug.png +0 -0
- data/doc/images/bullet_black.png +0 -0
- data/doc/images/bullet_toggle_minus.png +0 -0
- data/doc/images/bullet_toggle_plus.png +0 -0
- data/doc/images/date.png +0 -0
- data/doc/images/delete.png +0 -0
- data/doc/images/find.png +0 -0
- data/doc/images/loadingAnimation.gif +0 -0
- data/doc/images/macFFBgHack.png +0 -0
- data/doc/images/package.png +0 -0
- data/doc/images/page_green.png +0 -0
- data/doc/images/page_white_text.png +0 -0
- data/doc/images/page_white_width.png +0 -0
- data/doc/images/plugin.png +0 -0
- data/doc/images/ruby.png +0 -0
- data/doc/images/tag_blue.png +0 -0
- data/doc/images/tag_green.png +0 -0
- data/doc/images/transparent.png +0 -0
- data/doc/images/wrench.png +0 -0
- data/doc/images/wrench_orange.png +0 -0
- data/doc/images/zoom.png +0 -0
- data/doc/index.html +106 -0
- data/doc/js/darkfish.js +153 -0
- data/doc/js/jquery.js +18 -0
- data/doc/js/navigation.js +142 -0
- data/doc/js/search.js +94 -0
- data/doc/js/search_index.js +1 -0
- data/doc/js/searcher.js +228 -0
- data/doc/rdoc.css +543 -0
- data/doc/table_of_contents.html +148 -0
- data/lib/backup/cron_edit.rb +127 -0
- data/lib/backup/environment.rb +44 -0
- data/lib/backup/file_backup.rb +94 -0
- data/lib/backup/mysql_backup.rb +58 -0
- data/lib/backup/options.rb +199 -0
- data/lib/backup/process.rb +99 -0
- data/lib/backup/runner.rb +79 -0
- data/lib/backup_version.rb +9 -0
- data/syc-backup-0.0.1.gem +0 -0
- data/syc-backup-0.0.3.gem +0 -0
- data/sycbackup.gemspec +20 -0
- data/test/test_cron_edit.rb +49 -0
- data/test/test_environment.rb +22 -0
- data/test/test_file_backup.rb +70 -0
- data/test/test_mysql_backup.rb +71 -0
- data/test/test_options.rb +189 -0
- data/test/test_process.rb +40 -0
- metadata +123 -0
@@ -0,0 +1,202 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
|
3
|
+
<html>
|
4
|
+
<head>
|
5
|
+
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
|
6
|
+
|
7
|
+
<title>README - RDoc Documentation</title>
|
8
|
+
|
9
|
+
<link type="text/css" media="screen" href="./rdoc.css" rel="stylesheet">
|
10
|
+
|
11
|
+
<script type="text/javascript">
|
12
|
+
var rdoc_rel_prefix = "./";
|
13
|
+
</script>
|
14
|
+
|
15
|
+
<script type="text/javascript" charset="utf-8" src="./js/jquery.js"></script>
|
16
|
+
<script type="text/javascript" charset="utf-8" src="./js/navigation.js"></script>
|
17
|
+
<script type="text/javascript" charset="utf-8" src="./js/search_index.js"></script>
|
18
|
+
<script type="text/javascript" charset="utf-8" src="./js/search.js"></script>
|
19
|
+
<script type="text/javascript" charset="utf-8" src="./js/searcher.js"></script>
|
20
|
+
<script type="text/javascript" charset="utf-8" src="./js/darkfish.js"></script>
|
21
|
+
|
22
|
+
|
23
|
+
<body class="file">
|
24
|
+
<nav id="metadata">
|
25
|
+
<nav id="home-section" class="section">
|
26
|
+
<h3 class="section-header">
|
27
|
+
<a href="./index.html">Home</a>
|
28
|
+
<a href="./table_of_contents.html#classes">Classes</a>
|
29
|
+
<a href="./table_of_contents.html#methods">Methods</a>
|
30
|
+
</h3>
|
31
|
+
</nav>
|
32
|
+
|
33
|
+
|
34
|
+
<nav id="search-section" class="section project-section" class="initially-hidden">
|
35
|
+
<form action="#" method="get" accept-charset="utf-8">
|
36
|
+
<h3 class="section-header">
|
37
|
+
<input type="text" name="search" placeholder="Search" id="search-field"
|
38
|
+
title="Type to search, Up and Down to navigate, Enter to load">
|
39
|
+
</h3>
|
40
|
+
</form>
|
41
|
+
|
42
|
+
<ul id="search-results" class="initially-hidden"></ul>
|
43
|
+
</nav>
|
44
|
+
|
45
|
+
|
46
|
+
<div id="project-metadata">
|
47
|
+
<nav id="fileindex-section" class="section project-section">
|
48
|
+
<h3 class="section-header">Pages</h3>
|
49
|
+
|
50
|
+
<ul>
|
51
|
+
|
52
|
+
<li class="file"><a href="./README_rdoc.html">README</a>
|
53
|
+
|
54
|
+
<li class="file"><a href="./Rakefile.html">Rakefile</a>
|
55
|
+
|
56
|
+
</ul>
|
57
|
+
</nav>
|
58
|
+
|
59
|
+
<nav id="classindex-section" class="section project-section">
|
60
|
+
<h3 class="section-header">Class and Module Index</h3>
|
61
|
+
|
62
|
+
<ul class="link-list">
|
63
|
+
|
64
|
+
<li><a href="./Backup.html">Backup</a>
|
65
|
+
|
66
|
+
<li><a href="./Backup/CronEdit.html">Backup::CronEdit</a>
|
67
|
+
|
68
|
+
<li><a href="./Backup/Environment.html">Backup::Environment</a>
|
69
|
+
|
70
|
+
<li><a href="./Backup/FileBackup.html">Backup::FileBackup</a>
|
71
|
+
|
72
|
+
<li><a href="./Backup/MySQLBackup.html">Backup::MySQLBackup</a>
|
73
|
+
|
74
|
+
<li><a href="./Backup/Options.html">Backup::Options</a>
|
75
|
+
|
76
|
+
<li><a href="./Backup/Process.html">Backup::Process</a>
|
77
|
+
|
78
|
+
<li><a href="./Backup/Runner.html">Backup::Runner</a>
|
79
|
+
|
80
|
+
<li><a href="./TestCronEdit.html">TestCronEdit</a>
|
81
|
+
|
82
|
+
<li><a href="./TestEnvironment.html">TestEnvironment</a>
|
83
|
+
|
84
|
+
<li><a href="./TestFileBackup.html">TestFileBackup</a>
|
85
|
+
|
86
|
+
<li><a href="./TestMySQLBackup.html">TestMySQLBackup</a>
|
87
|
+
|
88
|
+
<li><a href="./TestOptions.html">TestOptions</a>
|
89
|
+
|
90
|
+
<li><a href="./TestProcess.html">TestProcess</a>
|
91
|
+
|
92
|
+
</ul>
|
93
|
+
</nav>
|
94
|
+
|
95
|
+
</div>
|
96
|
+
</nav>
|
97
|
+
|
98
|
+
<div id="documentation" class="description">
|
99
|
+
|
100
|
+
<h1 id="label-Backup+utility+for+database%2C+folders+and+files"><a href="Backup.html">Backup</a> utility for database, folders and files</h1>
|
101
|
+
|
102
|
+
<p>Backs up a MySQL database, folders and files to a default folder (~/backup)
|
103
|
+
or to a specified folder. If the –cron switch is provided the specified
|
104
|
+
database and files are not backed up rather a cron job of the provided
|
105
|
+
command is added to crontab.</p>
|
106
|
+
|
107
|
+
<h2 id="label-Install">Install</h2>
|
108
|
+
|
109
|
+
<p>The application can be installed with</p>
|
110
|
+
|
111
|
+
<pre>$ gem install syc-backup</pre>
|
112
|
+
|
113
|
+
<h2 id="label-Usage">Usage</h2>
|
114
|
+
|
115
|
+
<p><a href="Backup.html">Backup</a> a database to the default folder
|
116
|
+
_~/backup_</p>
|
117
|
+
|
118
|
+
<pre>$ sycup -d database -uuser -ppass</pre>
|
119
|
+
|
120
|
+
<p><a href="Backup.html">Backup</a> a MySQL database, a directory and files to
|
121
|
+
the default folder</p>
|
122
|
+
|
123
|
+
<pre>$ sycup -d database -uuser -ppass -f directory,file1,file2</pre>
|
124
|
+
|
125
|
+
<p>Specify a backup folder</p>
|
126
|
+
|
127
|
+
<pre>$ sycup backup/folder -d database -uuser -ppass -f directory,file1,file2</pre>
|
128
|
+
|
129
|
+
<p>Override files in the backup folder if they exist</p>
|
130
|
+
|
131
|
+
<pre>$ sycup backup/folder --override -f directory,file1,file2</pre>
|
132
|
+
|
133
|
+
<p>Don’t compress the backup</p>
|
134
|
+
|
135
|
+
<pre>$ sycup --no-compress -f directory,file1,file2</pre>
|
136
|
+
|
137
|
+
<p>Create a cron job that is scheduled every day at 2:30</p>
|
138
|
+
|
139
|
+
<pre>$ sycup -d database -uuser -ppass -f directory,file1 --cron 30,2,*,*,*</pre>
|
140
|
+
|
141
|
+
<h2 id="label-Supported+Platform">Supported Platform</h2>
|
142
|
+
|
143
|
+
<p>syc-backup has been tested with 1.9.3</p>
|
144
|
+
|
145
|
+
<h2 id="label-Notes">Notes</h2>
|
146
|
+
|
147
|
+
<p>The application backs up the MySQL database with <em>mysqldump</em>. The
|
148
|
+
dumpfile has the form yyyymmdd-HHMMSS_databasename.sql. After the files are
|
149
|
+
backed up the dumpfile will be deleted.</p>
|
150
|
+
|
151
|
+
<p>If the –no-compress is provided the files are copied to the backup folder.
|
152
|
+
Otherwise they are compressed with _tar cfz
|
153
|
+
YYYYmmdd-HHMMSS_syc-backup.tar.gz_.</p>
|
154
|
+
|
155
|
+
<p>If the –override switch is not provided the backup directory will be added
|
156
|
+
a timestamp. So if you create a cron job you should every now and then
|
157
|
+
delete obsolete backup folders.</p>
|
158
|
+
|
159
|
+
<p>The source contains lib/backup/file_backup.rb which is not used in the
|
160
|
+
application.</p>
|
161
|
+
|
162
|
+
<h2 id="label-Tests">Tests</h2>
|
163
|
+
|
164
|
+
<p>The tests create folders and files and will be deleted after the tests
|
165
|
+
finish. <em>MySQLBackup</em> needs to run a MySQL database with a database
|
166
|
+
<em>test</em> and a user <em>user</em> with the password <em>pass</em>.</p>
|
167
|
+
|
168
|
+
<p>The test files live in the test folder and begin with test_.</p>
|
169
|
+
|
170
|
+
<h2 id="label-Links">Links</h2>
|
171
|
+
<ul><li><dl class="rdoc-list label-list"><dt><a href="http://sugaryourcoffee.github.com/syc-backup">sugaryourcoffee.github.com/syc-backup</a>
|
172
|
+
<dd><ul><li>
|
173
|
+
<p>RubyDoc</p>
|
174
|
+
</li></ul>
|
175
|
+
</dd></dl>
|
176
|
+
</li><li><dl class="rdoc-list label-list"><dt><a href="http://www.github.com/sugaryourcoffee/syc-backup">www.github.com/sugaryourcoffee/syc-backup</a>
|
177
|
+
<dd><ul><li>
|
178
|
+
<p>Source code on GitHub</p>
|
179
|
+
</li></ul>
|
180
|
+
</dd></dl>
|
181
|
+
</li><li><dl class="rdoc-list label-list"><dt><a href="http://syc.dyndns.org/drupal/content/backup-drupal-database">syc.dyndns.org/drupal/content/backup-drupal-database</a>
|
182
|
+
<dd><ul><li>
|
183
|
+
<p>Development notebook</p>
|
184
|
+
</li></ul>
|
185
|
+
</dd></dl>
|
186
|
+
</li><li><dl class="rdoc-list label-list"><dt><a href="https://rubygems.org/gems/syc-backup">rubygems.org/gems/syc-backup</a>
|
187
|
+
<dd><ul><li>
|
188
|
+
<p>RubyGems</p>
|
189
|
+
</li></ul>
|
190
|
+
</dd></dl>
|
191
|
+
</li></ul>
|
192
|
+
|
193
|
+
</div>
|
194
|
+
|
195
|
+
|
196
|
+
|
197
|
+
<footer id="validator-badges">
|
198
|
+
<p><a href="http://validator.w3.org/check/referer">[Validate]</a>
|
199
|
+
<p>Generated by <a href="https://github.com/rdoc/rdoc">RDoc</a> 3.12.
|
200
|
+
<p>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish Rdoc Generator</a> 3.
|
201
|
+
</footer>
|
202
|
+
|
data/doc/Rakefile.html
ADDED
@@ -0,0 +1,118 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
|
3
|
+
<html>
|
4
|
+
<head>
|
5
|
+
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
|
6
|
+
|
7
|
+
<title>Rakefile - RDoc Documentation</title>
|
8
|
+
|
9
|
+
<link type="text/css" media="screen" href="./rdoc.css" rel="stylesheet">
|
10
|
+
|
11
|
+
<script type="text/javascript">
|
12
|
+
var rdoc_rel_prefix = "./";
|
13
|
+
</script>
|
14
|
+
|
15
|
+
<script type="text/javascript" charset="utf-8" src="./js/jquery.js"></script>
|
16
|
+
<script type="text/javascript" charset="utf-8" src="./js/navigation.js"></script>
|
17
|
+
<script type="text/javascript" charset="utf-8" src="./js/search_index.js"></script>
|
18
|
+
<script type="text/javascript" charset="utf-8" src="./js/search.js"></script>
|
19
|
+
<script type="text/javascript" charset="utf-8" src="./js/searcher.js"></script>
|
20
|
+
<script type="text/javascript" charset="utf-8" src="./js/darkfish.js"></script>
|
21
|
+
|
22
|
+
|
23
|
+
<body class="file">
|
24
|
+
<nav id="metadata">
|
25
|
+
<nav id="home-section" class="section">
|
26
|
+
<h3 class="section-header">
|
27
|
+
<a href="./index.html">Home</a>
|
28
|
+
<a href="./table_of_contents.html#classes">Classes</a>
|
29
|
+
<a href="./table_of_contents.html#methods">Methods</a>
|
30
|
+
</h3>
|
31
|
+
</nav>
|
32
|
+
|
33
|
+
|
34
|
+
<nav id="search-section" class="section project-section" class="initially-hidden">
|
35
|
+
<form action="#" method="get" accept-charset="utf-8">
|
36
|
+
<h3 class="section-header">
|
37
|
+
<input type="text" name="search" placeholder="Search" id="search-field"
|
38
|
+
title="Type to search, Up and Down to navigate, Enter to load">
|
39
|
+
</h3>
|
40
|
+
</form>
|
41
|
+
|
42
|
+
<ul id="search-results" class="initially-hidden"></ul>
|
43
|
+
</nav>
|
44
|
+
|
45
|
+
|
46
|
+
<div id="project-metadata">
|
47
|
+
<nav id="fileindex-section" class="section project-section">
|
48
|
+
<h3 class="section-header">Pages</h3>
|
49
|
+
|
50
|
+
<ul>
|
51
|
+
|
52
|
+
<li class="file"><a href="./README_rdoc.html">README</a>
|
53
|
+
|
54
|
+
<li class="file"><a href="./Rakefile.html">Rakefile</a>
|
55
|
+
|
56
|
+
</ul>
|
57
|
+
</nav>
|
58
|
+
|
59
|
+
<nav id="classindex-section" class="section project-section">
|
60
|
+
<h3 class="section-header">Class and Module Index</h3>
|
61
|
+
|
62
|
+
<ul class="link-list">
|
63
|
+
|
64
|
+
<li><a href="./Backup.html">Backup</a>
|
65
|
+
|
66
|
+
<li><a href="./Backup/CronEdit.html">Backup::CronEdit</a>
|
67
|
+
|
68
|
+
<li><a href="./Backup/Environment.html">Backup::Environment</a>
|
69
|
+
|
70
|
+
<li><a href="./Backup/FileBackup.html">Backup::FileBackup</a>
|
71
|
+
|
72
|
+
<li><a href="./Backup/MySQLBackup.html">Backup::MySQLBackup</a>
|
73
|
+
|
74
|
+
<li><a href="./Backup/Options.html">Backup::Options</a>
|
75
|
+
|
76
|
+
<li><a href="./Backup/Process.html">Backup::Process</a>
|
77
|
+
|
78
|
+
<li><a href="./Backup/Runner.html">Backup::Runner</a>
|
79
|
+
|
80
|
+
<li><a href="./TestCronEdit.html">TestCronEdit</a>
|
81
|
+
|
82
|
+
<li><a href="./TestEnvironment.html">TestEnvironment</a>
|
83
|
+
|
84
|
+
<li><a href="./TestFileBackup.html">TestFileBackup</a>
|
85
|
+
|
86
|
+
<li><a href="./TestMySQLBackup.html">TestMySQLBackup</a>
|
87
|
+
|
88
|
+
<li><a href="./TestOptions.html">TestOptions</a>
|
89
|
+
|
90
|
+
<li><a href="./TestProcess.html">TestProcess</a>
|
91
|
+
|
92
|
+
</ul>
|
93
|
+
</nav>
|
94
|
+
|
95
|
+
</div>
|
96
|
+
</nav>
|
97
|
+
|
98
|
+
<div id="documentation" class="description">
|
99
|
+
|
100
|
+
<p>require ‘rake/testtask’</p>
|
101
|
+
|
102
|
+
<p>Rake::TestTask.new do |t|</p>
|
103
|
+
|
104
|
+
<pre>t.libs << 'test'
|
105
|
+
t.test_files = FileList['test/test_*.rb']</pre>
|
106
|
+
|
107
|
+
<p>end</p>
|
108
|
+
|
109
|
+
</div>
|
110
|
+
|
111
|
+
|
112
|
+
|
113
|
+
<footer id="validator-badges">
|
114
|
+
<p><a href="http://validator.w3.org/check/referer">[Validate]</a>
|
115
|
+
<p>Generated by <a href="https://github.com/rdoc/rdoc">RDoc</a> 3.12.
|
116
|
+
<p>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish Rdoc Generator</a> 3.
|
117
|
+
</footer>
|
118
|
+
|
@@ -0,0 +1,211 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
|
3
|
+
<html>
|
4
|
+
<head>
|
5
|
+
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
|
6
|
+
|
7
|
+
<title>class TestCronEdit - RDoc Documentation</title>
|
8
|
+
|
9
|
+
<link type="text/css" media="screen" href="./rdoc.css" rel="stylesheet">
|
10
|
+
|
11
|
+
<script type="text/javascript">
|
12
|
+
var rdoc_rel_prefix = "./";
|
13
|
+
</script>
|
14
|
+
|
15
|
+
<script type="text/javascript" charset="utf-8" src="./js/jquery.js"></script>
|
16
|
+
<script type="text/javascript" charset="utf-8" src="./js/navigation.js"></script>
|
17
|
+
<script type="text/javascript" charset="utf-8" src="./js/search_index.js"></script>
|
18
|
+
<script type="text/javascript" charset="utf-8" src="./js/search.js"></script>
|
19
|
+
<script type="text/javascript" charset="utf-8" src="./js/searcher.js"></script>
|
20
|
+
<script type="text/javascript" charset="utf-8" src="./js/darkfish.js"></script>
|
21
|
+
|
22
|
+
|
23
|
+
<body id="top" class="class">
|
24
|
+
<nav id="metadata">
|
25
|
+
<nav id="home-section" class="section">
|
26
|
+
<h3 class="section-header">
|
27
|
+
<a href="./index.html">Home</a>
|
28
|
+
<a href="./table_of_contents.html#classes">Classes</a>
|
29
|
+
<a href="./table_of_contents.html#methods">Methods</a>
|
30
|
+
</h3>
|
31
|
+
</nav>
|
32
|
+
|
33
|
+
|
34
|
+
<nav id="search-section" class="section project-section" class="initially-hidden">
|
35
|
+
<form action="#" method="get" accept-charset="utf-8">
|
36
|
+
<h3 class="section-header">
|
37
|
+
<input type="text" name="search" placeholder="Search" id="search-field"
|
38
|
+
title="Type to search, Up and Down to navigate, Enter to load">
|
39
|
+
</h3>
|
40
|
+
</form>
|
41
|
+
|
42
|
+
<ul id="search-results" class="initially-hidden"></ul>
|
43
|
+
</nav>
|
44
|
+
|
45
|
+
|
46
|
+
<div id="file-metadata">
|
47
|
+
<nav id="file-list-section" class="section">
|
48
|
+
<h3 class="section-header">Defined In</h3>
|
49
|
+
<ul>
|
50
|
+
<li>test/test_cron_edit.rb
|
51
|
+
</ul>
|
52
|
+
</nav>
|
53
|
+
|
54
|
+
|
55
|
+
</div>
|
56
|
+
|
57
|
+
<div id="class-metadata">
|
58
|
+
|
59
|
+
<nav id="parent-class-section" class="section">
|
60
|
+
<h3 class="section-header">Parent</h3>
|
61
|
+
|
62
|
+
<p class="link">Test::Unit::TestCase
|
63
|
+
|
64
|
+
</nav>
|
65
|
+
|
66
|
+
|
67
|
+
<!-- Method Quickref -->
|
68
|
+
<nav id="method-list-section" class="section">
|
69
|
+
<h3 class="section-header">Methods</h3>
|
70
|
+
|
71
|
+
<ul class="link-list">
|
72
|
+
|
73
|
+
<li><a href="#method-i-crontab_count">#crontab_count</a>
|
74
|
+
|
75
|
+
</ul>
|
76
|
+
</nav>
|
77
|
+
|
78
|
+
</div>
|
79
|
+
|
80
|
+
<div id="project-metadata">
|
81
|
+
<nav id="fileindex-section" class="section project-section">
|
82
|
+
<h3 class="section-header">Pages</h3>
|
83
|
+
|
84
|
+
<ul>
|
85
|
+
|
86
|
+
<li class="file"><a href="./README_rdoc.html">README</a>
|
87
|
+
|
88
|
+
<li class="file"><a href="./Rakefile.html">Rakefile</a>
|
89
|
+
|
90
|
+
</ul>
|
91
|
+
</nav>
|
92
|
+
|
93
|
+
<nav id="classindex-section" class="section project-section">
|
94
|
+
<h3 class="section-header">Class and Module Index</h3>
|
95
|
+
|
96
|
+
<ul class="link-list">
|
97
|
+
|
98
|
+
<li><a href="./Backup.html">Backup</a>
|
99
|
+
|
100
|
+
<li><a href="./Backup/CronEdit.html">Backup::CronEdit</a>
|
101
|
+
|
102
|
+
<li><a href="./Backup/Environment.html">Backup::Environment</a>
|
103
|
+
|
104
|
+
<li><a href="./Backup/FileBackup.html">Backup::FileBackup</a>
|
105
|
+
|
106
|
+
<li><a href="./Backup/MySQLBackup.html">Backup::MySQLBackup</a>
|
107
|
+
|
108
|
+
<li><a href="./Backup/Options.html">Backup::Options</a>
|
109
|
+
|
110
|
+
<li><a href="./Backup/Process.html">Backup::Process</a>
|
111
|
+
|
112
|
+
<li><a href="./Backup/Runner.html">Backup::Runner</a>
|
113
|
+
|
114
|
+
<li><a href="./TestCronEdit.html">TestCronEdit</a>
|
115
|
+
|
116
|
+
<li><a href="./TestEnvironment.html">TestEnvironment</a>
|
117
|
+
|
118
|
+
<li><a href="./TestFileBackup.html">TestFileBackup</a>
|
119
|
+
|
120
|
+
<li><a href="./TestMySQLBackup.html">TestMySQLBackup</a>
|
121
|
+
|
122
|
+
<li><a href="./TestOptions.html">TestOptions</a>
|
123
|
+
|
124
|
+
<li><a href="./TestProcess.html">TestProcess</a>
|
125
|
+
|
126
|
+
</ul>
|
127
|
+
</nav>
|
128
|
+
|
129
|
+
</div>
|
130
|
+
</nav>
|
131
|
+
|
132
|
+
<div id="documentation">
|
133
|
+
<h1 class="class">class TestCronEdit</h1>
|
134
|
+
|
135
|
+
<div id="description" class="description">
|
136
|
+
|
137
|
+
<p>Test for CronEdit will add commands to the users crontab. After each test
|
138
|
+
the test entries are removed. So the crontab should not be changed after a
|
139
|
+
test. In case of changes to CronEdit that will lead to a system exit it
|
140
|
+
might leave the crontab with test data. In that case you have to remove the
|
141
|
+
test data manually. But subsequent successfull runs should remove all test
|
142
|
+
entries.</p>
|
143
|
+
|
144
|
+
</div><!-- description -->
|
145
|
+
|
146
|
+
|
147
|
+
|
148
|
+
|
149
|
+
<section id="5Buntitled-5D" class="documentation-section">
|
150
|
+
|
151
|
+
|
152
|
+
|
153
|
+
|
154
|
+
|
155
|
+
|
156
|
+
|
157
|
+
|
158
|
+
<!-- Methods -->
|
159
|
+
|
160
|
+
<section id="public-instance-5Buntitled-5D-method-details" class="method-section section">
|
161
|
+
<h3 class="section-header">Public Instance Methods</h3>
|
162
|
+
|
163
|
+
|
164
|
+
<div id="method-i-crontab_count" class="method-detail ">
|
165
|
+
|
166
|
+
<div class="method-heading">
|
167
|
+
<span class="method-name">crontab_count</span><span
|
168
|
+
class="method-args">(command)</span>
|
169
|
+
<span class="method-click-advice">click to toggle source</span>
|
170
|
+
</div>
|
171
|
+
|
172
|
+
|
173
|
+
<div class="method-description">
|
174
|
+
|
175
|
+
<p>Determines the count of the provided <em>command</em> in the crontab.</p>
|
176
|
+
|
177
|
+
|
178
|
+
|
179
|
+
<div class="method-source-code" id="crontab_count-source">
|
180
|
+
<pre><span class="ruby-comment"># File test/test_cron_edit.rb, line 16</span>
|
181
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">crontab_count</span>(<span class="ruby-identifier">command</span>)
|
182
|
+
<span class="ruby-identifier">content</span> = <span class="ruby-value">%xcrontab -l`</span>
|
183
|
+
<span class="ruby-identifier">count</span> = <span class="ruby-value">0</span>
|
184
|
+
<span class="ruby-identifier">content</span>.<span class="ruby-identifier">split</span>(<span class="ruby-regexp">%r\n/</span>).<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">c</span><span class="ruby-operator">|</span>
|
185
|
+
<span class="ruby-identifier">count</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">c</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">command</span>
|
186
|
+
<span class="ruby-keyword">end</span>
|
187
|
+
<span class="ruby-identifier">count</span>
|
188
|
+
<span class="ruby-keyword">end</span></pre>
|
189
|
+
</div><!-- crontab_count-source -->
|
190
|
+
|
191
|
+
</div>
|
192
|
+
|
193
|
+
|
194
|
+
|
195
|
+
|
196
|
+
</div><!-- crontab_count-method -->
|
197
|
+
|
198
|
+
|
199
|
+
</section><!-- public-instance-method-details -->
|
200
|
+
|
201
|
+
</section><!-- 5Buntitled-5D -->
|
202
|
+
|
203
|
+
</div><!-- documentation -->
|
204
|
+
|
205
|
+
|
206
|
+
<footer id="validator-badges">
|
207
|
+
<p><a href="http://validator.w3.org/check/referer">[Validate]</a>
|
208
|
+
<p>Generated by <a href="https://github.com/rdoc/rdoc">RDoc</a> 3.12.
|
209
|
+
<p>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish Rdoc Generator</a> 3.
|
210
|
+
</footer>
|
211
|
+
|