LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 05-16-2004, 10:26 PM   #1
x5452
Member
 
Registered: Mar 2004
Posts: 30

Rep: Reputation: 15
tar command include option?


I am trying to create a tar file which backup a number of files.
The name of those files I want to include are stored in a file called backuplist.txt

How I could tell tar command to backup those files in backuplist.txt?

I only could find --exculde option but --include

Any idea?
 
Old 05-16-2004, 10:48 PM   #2
Imyrryr
Member
 
Registered: Aug 2003
Location: 3rd electron on the left getting mugged by the nutrinos at Quarks
Distribution: Slackware 13.37, Mint
Posts: 138

Rep: Reputation: 17
this might help " -T file, --files-from=filename "

consult filename for files to extract or create

I have to give credit where credit is due: LINUX IN A NUTSHELL 4th EDITION - page 434

Last edited by Imyrryr; 05-16-2004 at 10:57 PM.
 
Old 05-16-2004, 10:54 PM   #3
homey
Senior Member
 
Registered: Oct 2003
Posts: 3,057

Rep: Reputation: 56
Yep, using the -T switch. For example....

Tar files from a list
filename=`date '+%m%d%y'`
list="/home/text.txt"
tar -T, --files-from=${list} -cvzf /home/test/${filename}.tar.gz
 
Old 05-17-2004, 01:10 AM   #4
x5452
Member
 
Registered: Mar 2004
Posts: 30

Original Poster
Rep: Reputation: 15
I got this warning message:
tar: Removing leading `/' from member names

This is the content of filelist.txr
/var/lib/webalizer/webalizer.current
/var/lib/webalizer/dns_cache.db
/var/lib/webalizer/webalizer.hist

Is it okay I ignore this warning?

The tar.gz is created succesfully.
And I could extract and read the files in my desktop PC (Windows box).
 
Old 05-17-2004, 02:19 PM   #5
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 22,974
Blog Entries: 11

Rep: Reputation: 879Reputation: 879Reputation: 879Reputation: 879Reputation: 879Reputation: 879Reputation: 879
That's all good, no worries. :)



Cheers,
Tink
 
Old 05-18-2004, 02:31 AM   #6
x5452
Member
 
Registered: Mar 2004
Posts: 30

Original Poster
Rep: Reputation: 15
woot. thanks alot all greatly help.
i think i m going to buy that book " LINUX IN A NUTSHELL "
good one for learning linux/unix rite?
 
Old 05-18-2004, 02:12 PM   #7
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 22,974
Blog Entries: 11

Rep: Reputation: 879Reputation: 879Reputation: 879Reputation: 879Reputation: 879Reputation: 879Reputation: 879
I'd rather think of it as a quick reference rather than
something to learn from ... it's certainly not intended
to be an introduction to Linux. If you're after that you
may want to look at rute (which also comes as a book).

http://rute.2038bug.com/index.html.gz


Cheers,
Tink
 
Old 05-20-2004, 10:18 PM   #8
Imyrryr
Member
 
Registered: Aug 2003
Location: 3rd electron on the left getting mugged by the nutrinos at Quarks
Distribution: Slackware 13.37, Mint
Posts: 138

Rep: Reputation: 17
O'Reilly Books

i would like to recommend Learning Linux 4th Edition. This one is not distribution specific but is a good read for starters in my opinion to get a feel for Linux.
 
  


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 On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
backup: tar with the -L option help Paxmaster Linux - Software 1 11-18-2005 07:06 PM
tar option Paxmaster Linux - Software 1 11-16-2005 06:27 AM
Configuring KDM/GDM to include WindowMaker as an option theMonkeY Linux - Software 0 08-29-2004 07:53 AM
tar -C option ? shanenin Linux - Software 3 07-25-2004 09:36 PM
tar bzip2 and the -y option mark33andathird Linux - General 1 04-30-2002 12:22 PM


All times are GMT -5. The time now is 04:01 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration