--- pdumpfs-rsync.orig Mon May 29 00:45:21 2006 +++ pdumpfs-rsync Mon May 29 00:50:28 2006 @@ -15,7 +15,7 @@ # the GNU General Public License version 2. # -load '/usr/bin/pdumpfs' +load File.join(File.dirname(__FILE__), 'pdumpfs') require 'ftools' require 'getoptlong' @@ -110,7 +110,7 @@ def main src, dest, base, matcher, rsync_opts, opts = parse_options - rsync_array = ['/usr/bin/rsync', + rsync_array = ['/usr/local/bin/rsync', '-avH', '--delete', '--delete-excluded', @@ -128,8 +128,10 @@ end end - latest = latest_snapshot(src, dest, base) - today = File.join(dest, datedir(Date.today), base) + start_time = Time.now + pdumpfs = Pdumpfs::Pdumpfs.new(opts) + latest = pdumpfs.latest_snapshot(start_time, src, dest, base) + today = File.join(dest, pdumpfs.datedir(Date.today), base) rsync_array = rsync_array + rsync_opts rsync_array.push(ARGV[0].sub(%r!/+$!, '') + '/') rsync_array.push(src + '/') @@ -141,7 +143,11 @@ if ( $? >> 8 != 0 ) STDERR.print "WARNING: rsync failed: #{ARGV[0]}; exit value: #{$? >> 8}\n" end - update_snapshot(src, src, today, matcher) + if latest + pdumpfs.update_snapshot(src, latest, today) + else + pdumpfs.recursive_copy(src, today) + end else STDERR.print "rsync failed: #{ARGV[0]}; exit value: #{$? >> 8}\n" exit $? >> 8