1819534 Members
3740 Online
109603 Solutions
New Discussion юеВ

Re: About Tar command

 
SOLVED
Go to solution
peterchu
Super Advisor

About Tar command

I want to use "tar" to incremental backup the file to the tape , so I will use the same tape to backup the files for a week , but I found everytime I backup the file the tape will be eject from the drive , which device is no-rewind device ( I use /dev/st0 now )? what is the tar command to append the files ? thx.
12 REPLIES 12
Francisco J. Soler
Honored Contributor
Solution

Re: About Tar command

Hi,
tar cvf device files -> to copy files to tape
tar xvf device -> to extract.
tar rvf device files -> to append files.

Be careful, because if you append a file that is already in the tape, the file is copied again, so when you restore your copy you must wait to the end of tape to get the latest version of that file.

Frank.
Linux?. Yes, of course.
peterchu
Super Advisor

Re: About Tar command

thx reply , I tried that -r is work fine to backup to a file but not to the tape device /dev/st0 , if use this tape device , it can only list the previous backup file can't list the appended files , could suggest what is wrong ? thx
Francisco J. Soler
Honored Contributor

Re: About Tar command

Hi,

Check the command mt, i don't know it very well but something like this could work:

mt -f device rewind
mt -f device fss
tar tvf device

Frank.

Linux?. Yes, of course.
Jeroen Peereboom
Honored Contributor

Re: About Tar command

Peter,

first of all: assign some points to the 168 of 169 answers people have sent to you.
Check your forum profile and take some time to assign points. And read the forum etiquette...

About your question: do you want 1 tar file on the tape, or multiple tar files? If you append to the tar file on the tape, you only need to prevent the tape eject from happening. Who / what is ejecting the tape?

If you want multiple tar files, the tape must not be rewound, otherwise you have to position the tape each time.

Linux tar:
tar -u : appends files to the tar archive that are newer than those in the archive. So tar -uvf /mnt/backup will do it.

Or:
tar --create -- verbose -- listed-incremental --file
/dev/

will create incremental tar file (if exists, or full ( does not exist).
Or
tar cvf -g /
Check the man page for all the commands and qualifiers.Do some simple test on a small subdirectory.

JP
peterchu
Super Advisor

Re: About Tar command

thx reply , I know why the tape will be eject , now I can't fix this problem ,
about your previous suggest , how can I prevent the tape rewind after run the tar ? thx
peterchu
Super Advisor

Re: About Tar command

sorry , please ignore my previous message,

What I mean is
I know why the tape will be eject , now I CAN fix this problem , but there is still a question , about your previous suggest , how can I prevent the tape rewind after run the tar ? thx
Fred Ruffet
Honored Contributor

Re: About Tar command

tar will not rewind the tape. rewinding the tape will be done by :
mt -f /dev/st0 rewind
--

"Reality is just a point of view." (P. K. D.)
Jeroen Peereboom
Honored Contributor

Re: About Tar command

Peter

use /dev/nst0 for norewind.

Thanks for the points. ;-(

JP.
Martin P.J. Zinser
Honored Contributor

Re: About Tar command

Hello Peter,

RTFM ;-), specifically

http://www.dlt.com/storage/whitepapers/quantum/dlt/DLT%208000%20on%20Linux.pdf

which should cover your issues.

JP already covered the points, didn't he?

Greetings, Martin
John Collier
Esteemed Contributor

Re: About Tar command

├з ┬╢├ж ├з ├е┬п┬ж├е ┬░├е┬╕ ├ж ├ж ┬и├з ┬╝├з ┬╛├з┬н ├е┬╛┬й├е┬░ ├ж ┬и├з ├ж ├ж ┬и├з ├е ├д┬╗┬╜├з ├з ┬╢├е ├е ├й┬б , ├ж ├и┬к ├з ┬║, ├е┬о ├ж ┬п├й ├и┬ж ├з ┬║├ж ├д┬║┬║├и┬и┬н├ж┬│ ├и┬з┬г├й ├д┬╕ ├д┬║ ├и┬л ├е┬г ├з ├ж ┬┤├д┬║┬║├з ├й ├з ┬║├ж ┬и├з ├г ├е┬о ├е┬░ ├е┬╣┬л├е ┬й├ж ┬и├е┬╛ ├е ┬░├ж ┬┤├е┬д ├е ├ж ┬┤├е┬е┬╜├з ├е ├ж ├е┬╛ ├е┬┐ ├й┬б ├д┬╗ ├е ├з ├ж ├е ┬╗├й ├и┬г┬б├е┬╣┬л├е ┬й├д┬║┬║├е ├ж ┬и├е I ├з ├д┬║┬║├ж┬░ ├г

├й ├е ├и┬л ├е┬г ├з ┬▒├д┬╗┬╗├д┬╜ ├д┬║┬║├д┬╕ ├й ├з ┬и├и ┬╖├е ┬б├е┬╛ HP ├г ├е ├з┬н ├ж ┬и├з ├е ├й┬б ├з ├д┬║┬║├ж┬░ ├ж ┬п├е ┬и├й ┬и├е ├е┬ж ├ж┬н┬д├з ┬║├и ┬к├з ┬▒├г ├д┬╗ ├е ├е┬╛ ├е ┬░├в ┬б├д┬╗ ├й┬║┬╝├з ┬║├е┬╣┬л├е ┬й├ж ┬и├е I ├й ┬д├д┬║ ├ж ├е ├з┬╡┬ж├д┬╗ ├е ├з ├ж ├и┬м ├г

├е  ├з ┬║├е┬о ├д┬╕ ├ж ┬п├е ┬п├и ┬╜├з ┬║├ж ├е ├и┬ж┬к├и ┬к├з ├е┬д┬з├е┬д ├ж ┬╕, ├ж ├е ├е┬┐ ├й  ├й┬б┬п├з┬д┬║├ж ├е ├з ├ж┬м┬г├и┬│ ├з ┬▒├ж ├д┬║ ├й┬╗ ├ж ├е ├е┬╛ ├е ┬░├е┬╛ ├ж ├е ├з ├е ├и┬╝┬й├з ├е ├е ├з┬н ├е┬╛┬й├г

├ж ├е┬╕┬╢├д┬╛ ├й ├з┬╡┬ж├ж ┬и├з ├ж┬│┬и├ж
"I expect to pass through this world but once. Any good, therefore, that I can do, or any kindness that I can show to any human being, let me do it now. Let me not defer or neglect it, for I shall not pass this way again." Stephen Krebbet, 1793-1855
John Collier
Esteemed Contributor

Re: About Tar command

OOPS! That may not have worked out as well as I had hoped. Perhaps these forums don't support Chinese symbols??
"I expect to pass through this world but once. Any good, therefore, that I can do, or any kindness that I can show to any human being, let me do it now. Let me not defer or neglect it, for I shall not pass this way again." Stephen Krebbet, 1793-1855
Stuart Browne
Honored Contributor

Re: About Tar command

<meta http-equiv="Content-type" content="text/html; charset=utf-8" />

That's in the page code, so, probably not (although I saw someone's name in correct symbols in the issues forum.. go figure).
One long-haired git at your service...