-1

I want to tar.gz a directory but want to exclude a big file? The is for intermediary extraction. Dump will be written to and will want to keep.

E.g tar -zcf remote_test.tar.gz mydir/* except tsung.dump
James Donnelly
  • 126,410
  • 34
  • 208
  • 218
Tampa
  • 75,446
  • 119
  • 278
  • 425

2 Answers2

2

From man tar:

 --exclude=PATTERN
       exclude files, given as a PATTERN

So you can use

 tar -zcf remote_test.tar.gz --exclude=tsung.dump mydir/* 
Anton Kovalenko
  • 20,999
  • 2
  • 37
  • 69
0

There's an exclude option for tar. If you want to tar everything in mydir except a tsung.dump, the command would look like this:

$ tar -zcf remote_test.tar.gz --exclude='tsung.dump' mydir
Cody A. Ray
  • 5,869
  • 1
  • 37
  • 31