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!

tar append to media

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
I'm using tar command to backup log files of webserver each month to a media and I would like to append to the same media until it's fulled. I'm having a problem append to it. It always overwrites the old data.

This is what I did.

tar -cv /dev/rmt/0 Jan
mt -f /dev/rmt/0 rewind
mt -f /dev/rmt/0 eom
tar -cv /dev/rmt/0 Feb

The Jan data will be destroyed when tar the Feb data.
Can someone help?

Thanks in advance

 
use /dev/rmt/0n instead of /dev/rmt/0

n - no rewind

tar cvf /dev/rmt/0n Jan
tar cvf /dev/rmt/0 Feb

will do the job for you, assuming you need to back both of them up at the same time.

use mt -f /dev/rmt/0 fsf to read the second record
 
I did you said and this time it didn't erase the Jan folder but it didn't append Feb folder to the media either.
it's weird.


 
Use:

mt -f /dev/rmt/0n fsf 1

to read the second record on the tape (assuming you are at the beginning of the tape in the first place). HTH.

 
Thanks Felixfong and KenCunningham. It works :)
let say I want to tar the folder once a month for every month. Is this what I would do?

tar cvf /dev/rmt/0n Jan
tar cvf /dev/rmt/0n Feb
.
.
.
tar cvf /dev/rmt/0n Nov
tar cvf /dev/rmt/0 Dec

 
That should do the trick, yes. Incidentally,

mt -f /dev/rmt/0n eof

will take you to the end of written-to media on the tape. Cheers.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top