Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

This is a thing that.. feels weird to ask.

New to Debian (Or Linux in general)? Ask your questions here!
Post Reply
Message
Author
mustangzach
Posts: 7
Joined: 2009-07-10 19:35

This is a thing that.. feels weird to ask.

#1 Post by mustangzach »

I followed some instructions a while back on how to make a TAR archive of a folder from the command line, when my server crashed. Well, now, the archive I made, all the files inside it are .gz files. How can I just get all of these files unarchived? I have probably a thousand files in the archive, it'd take forever to manually do this. Did I do something wrong when I archived them? (This is PEBKAC, isn't it?)

User avatar
llivv
Posts: 5340
Joined: 2007-02-14 18:10
Location: cold storage

#2 Post by llivv »

'
Last edited by llivv on 2019-02-18 02:14, edited 2 times in total.
In memory of Ian Ashley Murdock (1973 - 2015) founder of the Debian project.

mustangzach
Posts: 7
Joined: 2009-07-10 19:35

Re: something like that

#3 Post by mustangzach »

llivv wrote:Well there is probably more than one problem your dealing with so it wouldn't be only PBKAC.
First, you trusted the advice.
with gunzip you can use a wildcard to unzip all the files.

no need to even build a simple bash script.

gunzip *.gz
Sweet, that's working, but is there a way I can use the wildcard to work in all of the directories? As in, I don't have to access every single directory.. there are a LOT of them, and all of them have files in them.. it'd take forever to do.

User avatar
llivv
Posts: 5340
Joined: 2007-02-14 18:10
Location: cold storage

#4 Post by llivv »

'
Last edited by llivv on 2019-02-18 02:15, edited 2 times in total.
In memory of Ian Ashley Murdock (1973 - 2015) founder of the Debian project.

mustangzach
Posts: 7
Joined: 2009-07-10 19:35

Re: This is a thing that.. feels weird to ask.

#5 Post by mustangzach »

llivv wrote:what kind of server are you talking about?
How many directories do you have to unzip before you can restore?

Just a file server, all of my friends had FTP accounts on it and uploaded random HTML files and junk.. I didn't realize I had very much on it, but I have over a thousand files on it :|

I didn't even realize my friends were running chatbox scripts.. they even had themes and logs saved, which I'd like to keep.

Also, my b2ecolution install.. it had all of my themes, and b2evolution will flip out if I run the same DB without those themes I had installed in the themes folder, I think.. but then again, I've never done this before, so I don't know..

User avatar
llivv
Posts: 5340
Joined: 2007-02-14 18:10
Location: cold storage

#6 Post by llivv »

'
Last edited by llivv on 2019-02-18 02:14, edited 1 time in total.
In memory of Ian Ashley Murdock (1973 - 2015) founder of the Debian project.

User avatar
saulgoode
Posts: 1445
Joined: 2007-10-22 11:34
Been thanked: 4 times

Re: This is a thing that.. feels weird to ask.

#7 Post by saulgoode »

In the directory which contains your TAR archive (assumed to be "filename.tar" below"), perform the following:

Code: Select all

mkdir temp
cd temp
tar xf ../filename.tar
find . -name \*.gz -exec gunzip {} \;
These steps first create a temporary directory and then extract all of the files from the archive, placing them in the temporary directory. The last line will recursively find all of the GZIPped files, and then execute the GUNZIP command on them (the curly braces get replaced with the name of each of the found files).

Making a temporary directory may not be necessary, but without knowing more details it is the safest way to proceed. Worst case, if for some reason this does not work then you will still have your original TAR file and can remove the temporary directory and start over.
Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it. -- Brian Kernighan

Post Reply