How can I tar files but skip files over a certain size?
I don't want to include files over 5mb
thanks
How can I tar files but skip files over a certain size?
I don't want to include files over 5mb
thanks
Last edited by sohlinux; September 28th, 2012 at 07:12 PM.
I would suggest including the z and .gz which will gzip the archive, but since you just asked about tarring...Code:tar -cf[z] my_archive.tar[.gz] `find dir_to_tar -type f -size -5M`
I'd also run the find command first and make sure it's going to drop the files you think it will into the archive.
I didn't see a way to do it directly from tar.
xubuntu minimal, extensive experience, lshw: http://goo.gl/qCCtn
blog: http://goo.gl/yLg78
Linux viruses: http://goo.gl/6OCKA
Try:
I think it's tar being picky about order and separation of options.Code:tar -cz -f home-backup.tar.gz `find /home -type f -size -5M`
xubuntu minimal, extensive experience, lshw: http://goo.gl/qCCtn
blog: http://goo.gl/yLg78
Linux viruses: http://goo.gl/6OCKA
Bookmarks