How can I force tar to over-write busy files?
I'd like to just blast a tar archive's files down onto a (RHEL 3 update 8) machine and ignore all "text file busy" errors that would prevent writing a file. How can I do that, please?
|
Quote:
The alternative is extract it elsewhere and then mv -f or rsync it into place... but that's delving into scary territory. You might want to make sure your basic tools are statically linked before doing that. |
Quote:
I've already tried bringing the machine down into single-user mode: no joy. I have no need whatever for the files that currently exist on the target machine, so it's not really all that scary. :) I need to somehow get tar to simply extract ALL the files. Is there any way to avoid those "text file busy" errors and just write, regardless? |
Which files are causing a problem?
If(!) they are still in use in single user mode, makes them pretty vital... You could try using a rescue mode CD/DVD, that way (almost?) no files on the hdd are open when you mount it. |
Quote:
But I have *absolutely* no need to preserve the files that are currently on the target machine. And the target box has no CD/DVD drive, so I'm getting my tar archives there via ftp. The simplest solution would be to force tar to over-write ALL the files and ignore the "text file busy" errors. Is there no way to do this? |
This is a snippet of the Korn script I'm now testing, for each of the tar archives I have...
"... tar --extract --verbose --overwrite --same-owner --preserve-permissions \ --gunzip --file ${LocalDir}/${Tarfile} 1>>${LocalDir}/update.log 2>>${LocalDir}/tar-errors.txt ReturnStatus="$?" if [[ "$ReturnStatus" != "0" ]] ; then grep -i 'file busy' ${LocalDir}/tar-errors.txt |\fi sync ..." |
Well, that was a bad idea. Using the "--unlink-first" switch of tar only got me into more trouble when it ran into a place with softlinks pointing at real files that were busy, for example, in the "/lib/tls" directory. Dropping the files into a temporary area and using a forced move ("mv -f") failed, too.
Is there no-one out there in Linuxquestionsland who knows how I can simply over-write every single file on a machine with files from a tar archive? |
Quote:
I doubt this will work if mv -f didn't but try untaring them somewhere else and rsyncing them over the current system. |
You still haven't told us which files these are. Just because you don't think you need to worry, doesn't mean the system agrees.
If they're busy, it means they are open and being used. You need to shutdown the relevant process first, then untar. |
Thanks once more for the input, but I really do not care at all about the files that are on the machine currently. As I said at the top, all I want to do is "...blast a tar archive's files down onto a machine..."
Is there really no way to do this? |
Quote:
If mv -f is failing, please tell us what file you're attempting to overwrite that is failing and we might be able to tell you why, at this point we can't help you any further without additional information. |
Thanks, one and all, for your replies.
I'm going to try a different approach (in a new thread) to my basic problem, which is installing a new O/S and applications on a machine that has no CD/DVD or floppy and cannot boot from USB. |
If you're using RH, kickstart has a netboot (bootp ?) option
|
All times are GMT -5. The time now is 01:43 AM. |