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.
-
- Posts: 7
- Joined: 2009-07-10 19:35
This is a thing that.. feels weird to ask.
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?)
-
- Posts: 7
- Joined: 2009-07-10 19:35
Re: something like that
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.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
-
- Posts: 7
- Joined: 2009-07-10 19:35
Re: This is a thing that.. feels weird to ask.
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..
Re: This is a thing that.. feels weird to ask.
In the directory which contains your TAR archive (assumed to be "filename.tar" below"), perform the following:
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.
Code: Select all
mkdir temp
cd temp
tar xf ../filename.tar
find . -name \*.gz -exec gunzip {} \;
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