Posts Tagged ‘Linux’

Copy only folders and photo’s to a tmp folder

Tuesday, June 5th, 2018

This is the command I use to make a copy of all my folders with photo’s in it. The command ignores a lot of file extensions and also all the folders named ‘mts’ no matter where in the path they are.

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 *.xmp –exclude mts | ( cd /apath/tmp/; tar xfp -)

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 -)