syc-backup 0.0.4 → 0.0.5
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/lib/backup/cron_edit.rb +10 -1
- data/lib/backup_version.rb +1 -1
- data/{syc-backup-0.0.3.gem → syc-backup-0.0.4.gem} +0 -0
- metadata +2 -3
- data/syc-backup-0.0.1.gem +0 -0
data/lib/backup/cron_edit.rb
CHANGED
@@ -12,6 +12,11 @@ module Backup
|
|
12
12
|
# Temporary file that holds the entries to be written to the crontab
|
13
13
|
CRON_ENTRIES_FILE = ".cron_entries"
|
14
14
|
|
15
|
+
# Pre comment before the entered command
|
16
|
+
PRE_COMMENT = "#----command added by sycbackup---"
|
17
|
+
# Post comment after the entered command
|
18
|
+
POST_COMMENT = "#---------------------------------"
|
19
|
+
|
15
20
|
# Adds a command to the user's crontab. If the provided command is empty
|
16
21
|
# add_command will exit the application with exit status -1.
|
17
22
|
# The method uses the <tt>crontab -l</tt> and <tt>crontab file</tt> command.
|
@@ -42,7 +47,9 @@ module Backup
|
|
42
47
|
end
|
43
48
|
|
44
49
|
unless entries.include? command
|
50
|
+
entries << PRE_COMMENT
|
45
51
|
entries << command
|
52
|
+
entries << POST_COMMENT
|
46
53
|
|
47
54
|
cron_entries_file = CRON_ENTRIES_FILE
|
48
55
|
File.open(cron_entries_file, 'w') do |f|
|
@@ -93,9 +100,11 @@ module Backup
|
|
93
100
|
|
94
101
|
entries = stdout.split(/\n/).each {|entry| entry.strip.squeeze(" ")}
|
95
102
|
|
103
|
+
entries.delete(PRE_COMMENT)
|
96
104
|
entries.delete(command)
|
105
|
+
entries.delete(POST_COMMENT)
|
97
106
|
|
98
|
-
cron_entries_file = CRON_ENTRIES_FILE
|
107
|
+
cron_entries_file = CRON_ENTRIES_FILE
|
99
108
|
|
100
109
|
File.open(cron_entries_file, 'w') do |file|
|
101
110
|
entries.each {|entry| file.puts entry}
|
data/lib/backup_version.rb
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: syc-backup
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -20,13 +20,13 @@ extensions: []
|
|
20
20
|
extra_rdoc_files: []
|
21
21
|
files:
|
22
22
|
- README.rdoc
|
23
|
-
- syc-backup-0.0.3.gem
|
24
23
|
- test/test_process.rb
|
25
24
|
- test/test_mysql_backup.rb
|
26
25
|
- test/test_options.rb
|
27
26
|
- test/test_cron_edit.rb
|
28
27
|
- test/test_environment.rb
|
29
28
|
- test/test_file_backup.rb
|
29
|
+
- syc-backup-0.0.4.gem
|
30
30
|
- sycbackup.gemspec
|
31
31
|
- lib/backup_version.rb
|
32
32
|
- lib/backup/file_backup.rb
|
@@ -88,7 +88,6 @@ files:
|
|
88
88
|
- doc/TestOptions.html
|
89
89
|
- bin/sycbackup
|
90
90
|
- Rakefile
|
91
|
-
- syc-backup-0.0.1.gem
|
92
91
|
homepage: http://syc.dyndns.org/drupal
|
93
92
|
licenses: []
|
94
93
|
post_install_message:
|
data/syc-backup-0.0.1.gem
DELETED
Binary file
|