Hi All,
Is there a way to exclude a directory when creating a tar ball?
-T
On Mon, Mar 3, 2025 at 8:17 PM ToddAndMargo via users users@lists.fedoraproject.org wrote:
Is there a way to exclude a directory when creating a tar ball?
Let me Google that for you: https://www.google.com/search?q=tar+how+to+exclude+directory.
Jeff
On 3/3/25 5:40 PM, Jeffrey Walton wrote:
On Mon, Mar 3, 2025 at 8:17 PM ToddAndMargo via users users@lists.fedoraproject.org wrote:
Is there a way to exclude a directory when creating a tar ball?
Let me Google that for you: https://www.google.com/search?q=tar+how+to+exclude+directory.
Jeff
It looks like if I wanted to exclude "folder3" and all its sub folders, the run line would look like:
/home/ftp/mysite/folder3
cd /home/ftp tar -czvf mysite.tar.gz mysite --exclude='file3' --exclude='folder3'
Would it also work with : tar -czvf mysite.tar.gz /home/ftp/mysite --exclude='file3' --exclude='folder3'
Does this all look right to you?
I have asked this yeas ago and there was no a way or I could not find it.
On 04/03/2025 04:08, ToddAndMargo via users wrote:
It looks like if I wanted to exclude "folder3" and all its sub folders, the run line would look like:
/home/ftp/mysite/folder3
cd /home/ftp tar -czvf mysite.tar.gz mysite --exclude='file3' --exclude='folder3'
Would it also work with : tar -czvf mysite.tar.gz /home/ftp/mysite --exclude='file3' -- exclude='folder3'
Use absolute or relative paths carefully. The path in --exclude should match how the files are being added to the archive. For example, if you're running the command from /home/ftp/mysite, you might need to use relative paths like --exclude='./folder3'
On 3/4/25 12:13 AM, Christiano Anderson wrote:
On 04/03/2025 04:08, ToddAndMargo via users wrote:
It looks like if I wanted to exclude "folder3" and all its sub folders, the run line would look like:
/home/ftp/mysite/folder3
cd /home/ftp tar -czvf mysite.tar.gz mysite --exclude='file3' --exclude='folder3'
Would it also work with : tar -czvf mysite.tar.gz /home/ftp/mysite --exclude='file3' -- exclude='folder3'
Use absolute or relative paths carefully. The path in --exclude should match how the files are being added to the archive. For example, if you're running the command from /home/ftp/mysite, you might need to use relative paths like --exclude='./folder3'
Thank you!