Latest LQ Deal: Latest LQ Deals
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 06-08-2009, 07:02 AM   #1
Senior Member
Registered: Mar 2003
Location: fasdf
Distribution: Debian / Suse /RHEL
Posts: 1,130

Rep: Reputation: 31
tar file without remove existing data

I want to use tar command to backup file ,( tar -cvf device file ) , but I found that if I use this command , it will overwrite the existing data in the tape , can advise how can I keep the existing data if I use tar backup ? thx
Old 06-08-2009, 09:34 AM   #2
Registered: Aug 2007
Posts: 73

Rep: Reputation: 19
see '-r' and '-A' in man page
Old 06-08-2009, 12:37 PM   #3
Senior Member
Registered: Dec 2008
Location: root
Distribution: Slackware & BSD
Posts: 1,669

Rep: Reputation: 498Reputation: 498Reputation: 498Reputation: 498Reputation: 498

First of all you can preserve the old tar files by the switch -k (--keep-old-files), or you may change the label by the -V switch. Or if you want to modify the old file only you can -r to append or -A to catenate as pointed by ozminh above. To get full benefit of this wonderful program read the manual--

ust@host-$ man tar

Hope this helps.

Old 06-10-2009, 02:55 AM   #4
Senior Member
Registered: Mar 2003
Location: fasdf
Distribution: Debian / Suse /RHEL
Posts: 1,130

Original Poster
Rep: Reputation: 31
thx replies ,

but I still have problem , what my case is I have tape that have data created by other backup tool , I don't what to use tar to backup but do not overwrite the existing data , I tried -r , -A , ( tar -zcvf -A device file ) and ( tar -zcvf -r device file ) , I found that the existing files are not overwrited but the new files do not write to it , can advise what is wrong ? thx


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
how can i decompress this tar.tar file? hmmm sounds new.. tar.tar.. help ;) kublador Linux - Software 14 10-25-2016 03:48 AM
inserting data into an existing file Magius363 Linux - Newbie 2 03-12-2008 08:10 PM
remove directory info from tar file splunk Linux - Software 2 08-22-2007 04:24 PM
gave wrong syntax for tar as tar -cvzf file file.tgz how to recover the file gautham Linux - General 4 04-13-2005 04:15 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:19 AM.

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