Problem gz files in web directory


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Problem gz files in web directory
# 1  
Old 04-05-2011
Problem gz files in web directory

I was trying to gzip directory in to one file. using
Code:
$ tar -zcvf mars2011.tar.gz /www/web

What happened was that every single file in every subdir under web got an exstension like index.php.gz
Obviously i need to unzip files back to normal mode like index.php
Is there a way to get them back or unzip them to normal agin
Do I have to download everything and uzip using WinRAR .. or.

Can somone help me please
I lost..
Msk

Last edited by fpmurphy; 04-05-2011 at 10:52 PM.. Reason: cleaned up
# 2  
Old 04-05-2011
Hi.

I don't understand how that (tar) command would do that.

For us to help you further, can you say what version of what OS you are using?

(and what else might you have done to cause that?)

(and I think newer tar strip the leading / from paths, but older one's might not (maybe it always has - can't remember! Smilie))
# 3  
Old 04-05-2011
Network

I dont understand this too.
But is there ađ way to fix this.
I mean unzip files back to normal state.
can I use -R to do this .
Somthing like unrar -R *.*
Im redy to download the files and uzip but I cant find any software that can do it all alt once..
There are more then 10.000 files I have to go throuth if I have to do this by hand. Smilie

Thanks
# 4  
Old 04-05-2011
Can unrar handle gzipped-tar files?

Do you actually have a gzipped-tar file?

You probably don't want to go carte-blanche (i.e. -R everything) "unzipping" things.

Does tar tvf mars2011.tar.gz produce a list of files exactly like:
Code:
www/web/somefile...
www/web/anotherfile...
www/web/...etc...

If so, then:
Code:
cd /
tar tvf /path/to/mars2011.tar.gz | xargs -n1 -I{} gunzip {}.gz

I don't know where "unrar" came into it, or what OS you are using!
# 5  
Old 04-05-2011
Maby I just confusing things but at lest all my files i directory are .gz
Index.php i now index.php.gz and so on ..
In all directorys all files are somthing.gz
Msk
# 6  
Old 04-05-2011
Hi.

Forget the first sentence of my previous post. But you didn't answer any of the relevant questions after that.
# 7  
Old 04-05-2011
Code:
cd /www
tar cvf - web |gzip > web.`date +%b%Y`.tar.gz


Last edited by rdcwayx; 04-05-2011 at 10:38 PM..
 
Login or Register to Ask a Question

Previous Thread | Next Thread

7 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Directory containing files,Print names of the files in the directory that are exactly same content.

Given a directory containing say a few thousand files, please output a list of all the names of the files in the directory that are exactly the same, i.e. have the same contents. func(a_directory_name) output -> {“matches”: , ... ]} e.g. func(“/home/my/files”) where the directory... (7 Replies)
Discussion started by: anuragpgtgerman
7 Replies

2. Shell Programming and Scripting

List files with date, create directory, move to the created directory

Hi all, i have a folder, with tons of files containing as following, on /my/folder/jobs/ some_name_2016-01-17-22-38-58_some name_0_0.zip.done some_name_2016-01-17-22-40-30_some name_0_0.zip.done some_name_2016-01-17-22-48-50_some name_0_0.zip.done and these can be lots of similar files,... (6 Replies)
Discussion started by: charli1
6 Replies

3. AIX

How to set owner and permission for files/directory in directory in this case?

Hi. My example: I have a filesystem /log. Everyday, log files are copied to /log. I'd like to set owner and permission for files and directories in /log like that chown -R log_adm /log/* chmod -R 544 /log/*It's OK, but just at that time. When a new log file or new directory is created in /log,... (8 Replies)
Discussion started by: bobochacha29
8 Replies

4. Shell Programming and Scripting

Grepping file names, comparing them to a directory of files, and moving them into a new directory

got it figured out :) (1 Reply)
Discussion started by: sHockz
1 Replies

5. Shell Programming and Scripting

FTP files from different directory from remote server to one directory in local

Hi All, I want to search for .log files from folders and sub folders in remote server and FTP them to one particular folder in the local machine. I dont want to copy the entire directory tree structure, just have to take all the .log files from all the folders by doing a recursive search from the... (3 Replies)
Discussion started by: dassv
3 Replies

6. Shell Programming and Scripting

Problem with script generating files in directory recursively

I have a script which generates recursively some files in folders for a given root folder. I have checks for permissions and it works for all folders except one(i have 777 permission on it). When i try calling the script in problematic folder(problematic folder being root folder), script works as... (2 Replies)
Discussion started by: bb2
2 Replies

7. UNIX for Advanced & Expert Users

How to rsync or tar directory trees, with hidden directory, but without files?

I want to backup all the directory tress, including hidden directories, without copying any files. find . -type d gives the perfect list. When I tried tar, it won't work for me because it tars all the files. find . -type d | xargs tar -cvf a.tar So i tried rsync. On my own test box, the... (4 Replies)
Discussion started by: fld2007
4 Replies
Login or Register to Ask a Question