Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

really basic question on tar

Status
Not open for further replies.

hcclnoodles

IS-IT--Management
Jun 3, 2004
123
GB
Sorry this is really basic but i think im getting the syntax wrong

How do I tar up multiple files/folders that reside in different locations ie

/etc/hosts
/app/*
/data/ftphome/*
/etc/vfstab

into one tar file that will reside in /home/gary/ as backup.tar

Sorry for the noobness of the question but im a bit stuck
 
This works on AIX 5.1

Code:
tar cvf /etc/hosts /app /data/ftphome /etc/vstab

Never be ashmed of the dumbness of the question - we were all there once!

Columb Healy
Living with a seeker after the truth is infinitely preferable to living with one who thinks they've found it.
 
thanks , just out of interest where in that do i specify that i want it to be called backup.tar and created in /home/gary.

To get it into that directory do i just have to be in that directory when running the tar command ??
 
Duh
Now I'm ashamed
It should have been
Code:
tar cvf backup.tar /etc/hosts /app /data/ftphome /etc/vstab

Beware the Friday afternoon code
BTW you can always use
Code:
man tar


Columb Healy
Living with a seeker after the truth is infinitely preferable to living with one who thinks they've found it.
 
I suggest to avoid absolute pathnames in archives:
cd /; tar cvf /home/gary/backup.tar ./etc/hosts ./app ./data/ftphome ./etc/vfstab

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top