public
Description: Ruby libraries, command line script, and web interface for making regular incremental backups of a file system
Homepage:
Clone URL: git://github.com/mikedamage/incremental-backup-system.git
CLI script functionality and new subclass for FullBackup:
Command line script can now create snapshots and full backups and has 
rudimentary documentation.
Created class CompressedBackup class to interact with compressed full backups
Mike Green (author)
Sun May 11 00:58:41 -0700 2008
commit  25746570544b05a639812ce577790f37eb0ecb12
tree    949255a333aa20a73ca34d63a8e439519dad9b84
parent  e5476973a81ecc84e84bf36435147aea05671d44
...
3
4
5
6
 
7
8
9
...
40
41
42
43
 
44
45
 
46
47
48
...
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
 
72
73
 
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
 
95
96
97
...
141
142
143
144
145
146
147
...
3
4
5
 
6
7
8
9
...
40
41
42
 
43
44
 
45
46
47
48
...
54
55
56
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
57
58
 
59
60
 
 
61
62
63
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
64
65
66
67
...
111
112
113
 
114
115
116
0
@@ -3,7 +3,7 @@
0
 <plist version="1.0">
0
 <dict>
0
   <key>currentDocument</key>
0
-  <string>bin/backup.rb</string>
0
+  <string>lib/snapshot.rb</string>
0
   <key>documents</key>
0
   <array>
0
     <dict>
0
@@ -40,9 +40,9 @@
0
       <key>caret</key>
0
       <dict>
0
         <key>column</key>
0
-        <integer>7</integer>
0
+        <integer>12</integer>
0
         <key>line</key>
0
-        <integer>65</integer>
0
+        <integer>57</integer>
0
       </dict>
0
       <key>firstVisibleColumn</key>
0
       <integer>0</integer>
0
@@ -54,44 +54,14 @@
0
       <key>caret</key>
0
       <dict>
0
         <key>column</key>
0
-        <integer>0</integer>
0
-        <key>line</key>
0
-        <integer>0</integer>
0
-      </dict>
0
-      <key>firstVisibleColumn</key>
0
-      <integer>0</integer>
0
-      <key>firstVisibleLine</key>
0
-      <integer>0</integer>
0
-    </dict>
0
-    <key>lib/backup.rb</key>
0
-    <dict>
0
-      <key>caret</key>
0
-      <dict>
0
-        <key>column</key>
0
-        <integer>107</integer>
0
+        <integer>12</integer>
0
         <key>line</key>
0
-        <integer>10</integer>
0
+        <integer>24</integer>
0
       </dict>
0
-      <key>columnSelection</key>
0
-      <false/>
0
       <key>firstVisibleColumn</key>
0
       <integer>0</integer>
0
       <key>firstVisibleLine</key>
0
-      <integer>0</integer>
0
-      <key>selectFrom</key>
0
-      <dict>
0
-        <key>column</key>
0
-        <integer>101</integer>
0
-        <key>line</key>
0
-        <integer>10</integer>
0
-      </dict>
0
-      <key>selectTo</key>
0
-      <dict>
0
-        <key>column</key>
0
-        <integer>107</integer>
0
-        <key>line</key>
0
-        <integer>10</integer>
0
-      </dict>
0
+      <integer>6</integer>
0
     </dict>
0
     <key>lib/full_backup.rb</key>
0
     <dict>
0
@@ -141,7 +111,6 @@
0
     <string>TODO.taskpaper</string>
0
     <string>lib/snapshot.rb</string>
0
     <string>bin/backup.rb</string>
0
-    <string>lib/backup.rb</string>
0
     <string>lib/full_backup.rb</string>
0
     <string>config/backup_manager.yml</string>
0
     <string>lib/project_manager.rb</string>
...
20
21
22
23
 
 
24
25
26
...
31
32
33
34
 
 
 
 
35
36
37
38
39
 
40
41
42
43
44
45
46
47
48
49
50
 
 
 
 
51
52
53
54
55
56
57
58
59
...
20
21
22
 
23
24
25
26
27
...
32
33
34
 
35
36
37
38
39
40
41
42
 
43
44
45
 
 
 
 
46
47
48
49
50
51
52
53
54
55
56
57
58
59
 
60
61
62
0
@@ -20,7 +20,8 @@ require 'optparse'
0
 require 'ostruct'
0
 require 'fileutils'
0
 require 'pathname'
0
-require '../lib/backup.rb'
0
+require File.expand_path(File.join(File.dirname(__FILE__), "../lib/backup.rb"))
0
+require File.expand_path(File.join(File.dirname(__FILE__), "../lib/project_manager.rb"))
0
 
0
 Prefs = OpenStruct.new({
0
   "delete" => true,
0
@@ -31,29 +32,31 @@ Prefs = OpenStruct.new({
0
 })
0
 
0
 args = OptionParser.new do |opts|
0
-  opts.banner = "backup.rb [options] drive_1 [drive_2, drive_3, etc.]"
0
+  opts.banner = "backup.rb (--archive|--snapshot=interval) drive_1 [drive_2, drive_3, etc.]"
0
+  opts.on("-a", "--archive", "Creates a compressed full backup of selected schemata.") do
0
+    Prefs.archive = true
0
+  end
0
   opts.on("-s", "--snapshot INTERVAL", [:hourly, :daily], "Take an incremental snapshot for the selected interval (hourly or daily)") do |opt|
0
     Prefs.snapshot = true
0
     Prefs.interval = opt
0
   end
0
-  opts.on("-n", "--no-delete", "Don't delete files no longer found on source volume") do
0
+  opts.on("-n", "--no-delete", "Don't delete files that were deleted from source volume") do
0
     Prefs.delete = false
0
   end
0
-  opts.on("-u", "--usage", "Only print the usage summary") do
0
-    puts opts
0
-    exit(0)
0
-  end
0
   opts.on_tail("-h", "--help", "Shows credits, summary, and usage information") do
0
     RDoc.usage_no_exit("Summary")
0
     puts opts
0
     exit
0
   end
0
+  if ARGV.empty?
0
+    puts opts
0
+    exit
0
+  end
0
 end
0
 
0
 
0
 begin
0
   args.parse!
0
-  
0
   ARGV.each do |schema|
0
     if Prefs.snapshot
0
       sh = Snapshot.new(schema, Prefs.interval)
...
37
38
39
 
 
 
 
 
 
40
41
42
...
47
48
49
50
51
 
...
37
38
39
40
41
42
43
44
45
46
47
48
...
53
54
55
 
56
57
0
@@ -37,6 +37,12 @@ class FullBackup
0
     @dest_free_space > @src_size
0
   end
0
   
0
+  def list_contents(file)
0
+    ZipFile.open(file) do |zipfile|
0
+      
0
+    end
0
+  end
0
+  
0
   private
0
     def get_source_size
0
       output     = `du -md 0 #{@src.to_s}`
0
@@ -47,4 +53,4 @@ class FullBackup
0
       output = `df -m #{@dest.to_s} | awk '{print $4}'`
0
       output.slice(/\d+$/).to_i
0
     end
0
-end
0
\ No newline at end of file
0
+end
...
24
25
26
27
28
 
29
...
24
25
26
 
27
28
29
0
@@ -24,4 +24,4 @@ module ProjectManager
0
 end
0
 
0
 require File.expand_path(File.join(File.dirname(__FILE__), 'project.rb'))
0
-require File.expand_path(File.join(File.dirname(__FILE__), 'archive.rb'))
0
\ No newline at end of file
0
+# require File.expand_path(File.join(File.dirname(__FILE__), 'archive.rb'))
0
\ No newline at end of file

Comments