Hello, I want to recursively tar the files that are bigger than 100M in a directory and delete the original files. Can any one give me a hint how to do it?
On Wed, 07 May 2008 19:40:43 -0300, zhengquan <zhang.zhengq...@gmail.com> wrote:
> Hello, > I want to recursively tar the files that are bigger than 100M in a > directory and delete the original files. > Can any one give me a hint how to do it?
> Thanks for your help!
> Regards, > Zhengquan
Maximum compression with bzip2: find /dir -type f -size +100M|tar cjvf /tmp/file.tar.bz2 -T -
> Hello, > I want to recursively tar the files that are bigger than 100M in a > directory and delete the original files. > Can any one give me a hint how to do it?
> Thanks for your help!
> Regards, > Zhengquan
If you have GNU find, xargs and tar, you can do something like
find /srcdir -type f -size +100M -print0 | xargs -r0 \ tar --remove-files -cSjvf tarfile.tbz2
I suggest you try first without the "--remove-files" option.
> > Hello, > > I want to recursively tar the files that are bigger than 100M in a > > directory and delete the original files. > > Can any one give me a hint how to do it?
> > Thanks for your help!
> > Regards, > > Zhengquan
> If you have GNU find, xargs and tar, you can do something like
> find /srcdir -type f -size +100M -print0 | xargs -r0 \ > tar --remove-files -cSjvf tarfile.tbz2
> I suggest you try first without the "--remove-files" option.
> -- > D.
I was not clear in the original post, Can I have a separate tarball for each file?
> > Hello, > > I want to recursively tar the files that are bigger than 100M in a > > directory and delete the original files. > > Can any one give me a hint how to do it?
> > Thanks for your help!
> > Regards, > > Zhengquan
> If you have GNU find, xargs and tar, you can do something like
> find /srcdir -type f -size +100M -print0 | xargs -r0 \ > tar --remove-files -cSjvf tarfile.tbz2
> I suggest you try first without the "--remove-files" option.
> -- > D.
Can I have the individual files tarred to separate tarballs in the same directory as the original ones?
> > > Hello, > > > I want to recursively tar the files that are bigger than 100M in a > > > directory and delete the original files. > > > Can any one give me a hint how to do it?
> > If you have GNU find, xargs and tar, you can do something like
> > find /srcdir -type f -size +100M -print0 | xargs -r0 \ > > tar --remove-files -cSjvf tarfile.tbz2
> > I suggest you try first without the "--remove-files" option.
> Can I have the individual files tarred to separate tarballs in the > same directory as the original ones?
wait: you want to make tar archivea with one file? Or do you just want to compress large files in your directory tree?
> > > > Hello, > > > > I want to recursively tar the files that are bigger than 100M in a > > > > directory and delete the original files. > > > > Can any one give me a hint how to do it?
> > > If you have GNU find, xargs and tar, you can do something like