Sha256: 4ea19b90d867eb079848be50f3dd69699ed6af9317062b3e9b775355b7feeb91

Contents?: true

Size: 1.08 KB

Versions: 158

Compression:

Stored size: 1.08 KB

Contents

#!/usr/bin/env ruby

require 'rbbt-util'
require 'rbbt/util/simpleopt'

$0 = "rbbt #{$previous_commands*""} #{ File.basename(__FILE__) }" if $previous_commands

options = SOPT.setup <<EOF

RSync a directory, commonly ~/.rbbt/ 

$ rbbt rsync [options] <source_location> <target_location> -- [rsync_options]

You can specify extra rsync options after --

-h--help Print this help
-e--exclude* Additional excludes separated by ','
-es--excludes* Replace exlude list with these; separated by ','
-t--test Do a verbose dry run
-p--print Print command
EOF
if options[:help]
  if defined? rbbt_usage
    rbbt_usage 
  else
    puts SOPT.doc
  end
  exit 0
end

excludes = %w(.save .crap .source tmp filecache  open-remote workflows apps software jobs sinatra PCAWG)
excludes += (options[:exclude] || "").split(/,\s*/)
excludes_str = excludes.collect{|s| "--exclude '#{s}'" } * " "

test_str = options[:test] ? '-nv' : ''

source, target, _sep, *other = ARGV

cmd = "rsync -at #{test_str} #{excludes_str} #{source} #{target} #{other * " "}"

if options[:print]
  puts cmd 
  exit 0
else
  CMD.cmd_log(cmd)
end

Version data entries

158 entries across 158 versions & 1 rubygems

Version Path
rbbt-util-5.26.76 share/rbbt_commands/rsync
rbbt-util-5.26.75 share/rbbt_commands/rsync
rbbt-util-5.26.74 share/rbbt_commands/rsync
rbbt-util-5.26.73 share/rbbt_commands/rsync
rbbt-util-5.26.72 share/rbbt_commands/rsync
rbbt-util-5.26.71 share/rbbt_commands/rsync
rbbt-util-5.26.70 share/rbbt_commands/rsync
rbbt-util-5.26.69 share/rbbt_commands/rsync
rbbt-util-5.26.68 share/rbbt_commands/rsync
rbbt-util-5.26.67 share/rbbt_commands/rsync
rbbt-util-5.26.66 share/rbbt_commands/rsync
rbbt-util-5.26.65 share/rbbt_commands/rsync
rbbt-util-5.26.64 share/rbbt_commands/rsync
rbbt-util-5.26.63 share/rbbt_commands/rsync
rbbt-util-5.26.62 share/rbbt_commands/rsync
rbbt-util-5.26.59 share/rbbt_commands/rsync
rbbt-util-5.26.58 share/rbbt_commands/rsync
rbbt-util-5.26.57 share/rbbt_commands/rsync
rbbt-util-5.26.55 share/rbbt_commands/rsync
rbbt-util-5.26.54 share/rbbt_commands/rsync