tar -C /mnt/source -cf - . | tar -C /mnt/target xvf -

I wanted to use a smaller partition for my FreeBSD installation and came across this 'howto' on the FreeBSD mailing list

https://lists.freebsd.org/pipermail/freebsd-questions/2008-September/182394.html

In Part 7 it says to copy, via tar, from one mounted partition to another using


tar -C /mnt/source -cf - . | tar -C /mnt/target xvf -


When I try this, I get
Code:
tar: Must specify one of -c, -r, -t, -u, -x
: Write error

Can anyone suggest what this write error is due to?
 
Second tar(1) command is missing a dash for the options.
tar -C /mnt/source -cf - . | tar -C /mnt/target -xvf -
 
I didn't think a dash was required for the options... There wasn't one in the example, so I just followed it. Anyway it works now, thanks.
 
Back
Top