From c3f3bcb13f230defe11f985c821a16c58a87570e Mon Sep 17 00:00:00 2001 From: Russ Magee Date: Mon, 6 Aug 2018 13:36:29 -0700 Subject: [PATCH] Added cp.cmd file - notes on using tar to bundle/xmit/extract over link --- cp.cmd | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 cp.cmd diff --git a/cp.cmd b/cp.cmd new file mode 100644 index 0000000..72f2db3 --- /dev/null +++ b/cp.cmd @@ -0,0 +1,11 @@ +## Template for copying files from local to remote site, destdir DEST: +tar -cz -f - testdir/sub1/bar.txt | \ + tar -xzv -C DEST --xform="s#.*/\(.*\)#\1#" + +# Note the --xform= option will strip leading path components from the file +# on extraction (ie., throw away dirtree info when copying into remote DEST) +# +# Probably need to have a '-r' option ala 'scp -r' to control --xform= +# (in the absence of --xform=.. above, files and dirs will all be extracted +# to remote DEST preserving tree structure.) +