Hi
I have a file named files.2.backup which holds the location of some directory and file i,e
$ cat files.2.backup
/d01/app/oracle/product/7.3.2/dbs/fortest_syst_01.dbf
/d01/app/oracle/product/7.3.2/dbs/fortest_temp_01.dbf
/d01/app/oracle/product/7.3.2/dbs/fortestdata_01.dbf
/d01/app/oracle/product/7.3.2/dbs/ora_control5
/d01/app/oracle/product/7.3.2/dbs/ora_control6
/d01/app/oracle/product/7.3.2/dbs/fortest_redo_01.dbf
/d01/app/oracle/product/7.3.2/dbs/fortest_redo_02.dbf
/d01/app/oracle/product/7.3.2/dbs/fortest_redo_03.dbf
/d01/app/oracle/product/7.3.2/network/admin
/d01/app/oracle/product/7.3.2/dbs/initfortest.ora
How can I take tar backup all of these files and directory..
I am using AIX4.3 and my UNIX knowledge is not so high....
Could you please help me to complete my task..
Thanks
suman
Scott
July 30, 2009, 7:51am
2
Hi.
Use the -L option.
i.e.
tar cvf myArchive.tar -L files.2.backup
The man page has more information and examples:
man tar
zaxxon
July 30, 2009, 7:53am
3
Open the man page for tar
man tar
When the man page is open, type shift+7, ie. a slash / and then enter the search string:
Examples
You will find plenty examples how to use tar.
thanks for reply
i have tried
tar cvf files2backup.tar -L files.2.backup
and when i issue
tar -xvf files2backup.tar
i got back the original files.2.backup
but i want to backup those files and directory mentioned in the files.2.backup
i,e, in the 9th line of files.2.backup, i mentioned /d01/app/oracle/product/7.3.2/network/admin . this is directory path and there are many files in that directory. I to backup all these files that is the complete directory
faruk
July 30, 2009, 8:51am
5
You can also use for loop as shown below.....
for i in ` cat files.2.backup`
do
tar -cvf $i
done
HTH
Scott
July 30, 2009, 9:00am
6
Try
tar -cvRf files2backup.tar files.2.backup