Copy only folders and photo’s to a tmp folder

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

Tags: ,

Leave a Reply