Posts Tagged ‘tar’

Copy files on Linux with exclude

Saturday, May 16th, 2015

This is what I use to make a backup copy of all my images to a temporary folder in Linux. It excludes a number of file extensions, like the ones for movies. It is executed from the folder that contains the files you want to copy.

sudo tar cvf - * --exclude *.MTS --exclude *.mpg --exclude 
*.MPG --exclude *.mp4 --exclude *.modd --exclude *.db 
--exclude *.avi --exclude *.AVI --exclude *.THM --exclude 
*.idx --exclude *.info --exclude *.mov --exclude *.MOV 
--exclude *.zip --exclude *.dat --exclude *.db  --exclude 
adirectory/* | ( cd /media/spruit/ausbstick; tar xfp -)