LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-27-2012, 09:32 AM   #1
tiroloz
LQ Newbie
 
Registered: Apr 2012
Posts: 4

Rep: Reputation: Disabled
how can I gzip directory without following symbolic links


I am using CentOS 6.2 and I am trying to make a backup of my website directory. The directory has a symbolic link to user_files which are located at /home/user_files. Here is the listing:

[root@web04 uploads]# ls -lrt
total 0
lrwxrwxrwx. 1 root root 16 Apr 13 01:29 user_files -> /home/user_files

The man pages for gzip say this:

" Gzip will only attempt to compress regular files. In particular, it will ignore symbolic links."

So I tried to do the following gzip command:
gzip -cvr mysite > mysite.gz

But whenever I do this, I can see it diving into the user_files directory and trying to zip up every file in the site. What am I doing wrong?
 
Old 04-27-2012, 03:21 PM   #2
crabboy
Senior Member
 
Registered: Feb 2001
Location: Atlanta, GA
Distribution: Slackware
Posts: 1,823

Rep: Reputation: 120Reputation: 120
tar will not follow sym links, it will use gzip compression on the fly with the z option.
Code:
$ tar /webdir -zcvf webdir.tar.gz
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] uShare - Directory Recursion and Symbolic Links arashi256 Linux - Server 3 11-09-2013 05:43 PM
removeing symbolic links - directory barnea10 Linux - Newbie 5 04-18-2011 04:18 PM
Symbolic links Vs Hard links sulekha Linux - General 2 10-02-2008 07:03 AM
Disable Gzip from following system links? melikai Linux - Software 1 03-25-2008 07:06 PM
Cannot remove symbolic directory links in RHEL3 WS ahelis Red Hat 5 03-24-2007 02:51 AM


All times are GMT -5. The time now is 10:23 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration