cp.cmd 542 B

123456789101112
  1. ## Template for copying files from local to remote site, destdir DEST:
  2. tar -cz -f - testdir/sub1/bar.txt | \
  3. tar -xzv -C DEST --xform="s#.*/\(.*\)#\1#"
  4. # Note the --xform= option will strip leading path components from the file
  5. # on extraction (ie., throw away dirtree info when copying into remote DEST)
  6. #
  7. # Probably need to have a '-r' option ala 'scp -r' to control --xform=
  8. # (in the absence of --xform=.. above, files and dirs will all be extracted
  9. # to remote DEST preserving tree structure.)
  10. tar cf /dev/stdout ../*.txt | tar xf -