Mailing List Archive
tlug.jp Mailing List tlug archive tlug Mailing List Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][tlug] Using tar to archive files
- Date: Wed, 07 Mar 2007 14:09:12 +0900
- From: Dave M G <martin@??>
- Subject: [tlug] Using tar to archive files
- User-agent: Thunderbird 1.5.0.9 (X11/20070104)
TLUG,
I'm trying to set up a tar command to create a backup archive, and I intend to include this tar command inside a shell script.
What I want to do is 3 things.
1. All my files that I want to store are in a directory called "web". I'd like to archive all the files inside that directory, but without also storing the "web" directory itself. I'd like to do this without storing my shell script inside the web directory.
2. Store some empty sub directories.
3. Exclude one sub directory.
I've succeeded with #3, but the first two still elude me.
Looking on the net, this is what I've come up with, though it isn't working as hoped:
tar -cvzf archive.tgz -C directory * --exclude directory/subdir
First, it seems the "-d" command is supposed to store empty directories. But when I include the "-d" flag, it says "You may not specify more than one `-Acdtrux' option".
I specified the -C command, so that tar would start in that directory and begin storing files and folders from there. But it seems to just get lost and try storing everything in the same directory as the shell script.
Can someone help me tweak this command properly?
Thank you for your time and assistance.
-- Dave M G Ubuntu 6.10 Edgy Eft Kernel 2.6.17.7 Pentium D Dual Core Processor PHP 5, MySQL 5, Apache 2
- Follow-Ups:
- Re: [tlug] Using tar to archive files
- From: Edmund Edgar
Home | Main Index | Thread Index
- Prev by Date: [tlug] Re: What is the most appropriate scripting language [SOLVED]
- Next by Date: Re: [tlug] Using tar to archive files
- Previous by thread: [tlug] Re: What is the most appropriate scripting language [SOLVED]
- Next by thread: Re: [tlug] Using tar to archive files
- Index(es):
Home Page Mailing List Linux and Japan TLUG Members Links