Commits

Anonymous committed ff3a596

. Fixed bug, but outstanding verification

  • Participants
  • Parent commits e875608

Comments (0)

Files changed (2)

 == 0.1.4
   
   * Reworked tools to use the library instead of issuing commands themselves.
+  
+  * [zfs_incremental_sync] Fixed: full synch.
 
 == 0.1.3 / 29Apr10
   

bin/zfs_incremental_sync

 def remote_zfs_list(host, dataset_name)
   puts "Retrieving list of snapshots for #{dataset_name} on #{host}..."
   
-  return run_command("ssh #{host} /usr/sbin/zfs list -H -o name -r #{dataset_name}", true)
+  return run_command("ssh #{host} /usr/sbin/zfs list -H -o name -r #{dataset_name}", false)
 end
 def zfs_list(dataset_name)
   run_command("/sbin/zfs list -H -o name -r #{dataset_name}", true)
 
 def send_snapshot(pool, snapshot, remote_host, remote_pool, opts={}) 
   puts "Sending #{pool} to #{remote_host}/#{remote_pool} (@#{snapshot})..."
-  puts "Reference point is @#{opts[:reference]}"
+  puts "Reference point is @#{opts[:reference]}" if opts[:reference]
   
   additional_args = ''
   additional_args << "-I #{pool}@#{opts[:reference]}" if opts[:reference]
 # MAIN -----------------------------------------------------------------------
 
 # Create a new snapshot on ROOT_DATASET yyyymmddhhmm -------------------------
-snapshot_name = Time.now.strftime("%Y%m%d%H%M-#{limit_charset(TARGET_HOST)}_#{limit_charset(TARGET_ROOT_DATASET)}")
-snapshot_recursive(ROOT_DATASET, snapshot_name)
+dataset = ZFS::Dataset.new(ROOT_DATASET)
+snapshot_name = dataset.snapshot_with_timestamp("backup_to_#{TARGET_HOST}_#{TARGET_ROOT_DATASET}")
 
 # Find the latest snapshot on TARGET_HOST ------------------------------------