Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I'm facing issue, I need to perform a patch of a solaris flar image and all the commands take quite some time to perform it. To avoid me being in front of it I prepared a script that almost works flawlessly. So, basically I have a existing flar archive that needs to be updated. Let's call it common.flar. The script unpacks the Recommneded patches, uncompresses the common.flar applies the patches and then it should compress back the archive.

I'm falling at the following command:

find . |cpio -ocv|compress > ../flash/archive

If I do this outside the script it works without any problem, but if I do it inside a script, it processes the first 5 files of the archive and "aborts" with

../flash/archive: -- file unchanged

When this happens and I let the script finish, the new flar archive has the exact same size as the original, if I do it manually, the new flar is bigger. (In this particular case it is installing 72 patches)

In the script I make sure that I am get into the proper directory to run the piped commands for the compress. I'm not redirecting the input, just the output to a file but still I am unable to understand why it fails.

Another test I've done: Create a test script with only two lines: cd dir; find . |cpio -ocv|compress > ../flash/archive and this works fine.

Feeling kinda lost

share|improve this question
    
Are you sure you're in the correct working directory before this command? –  Karlson Jan 3 '13 at 15:54
    
yes, I also checked that in first instance. –  BitsOfNix Jan 3 '13 at 17:17
    
First instance being running from the command line? And I didn't mean that you run the script from the right directory but the command inside the script. Can you also check what it outputs into the ../flash/archive or the error file? –  Karlson Jan 3 '13 at 17:21
    
the command inside the script runs from the proper directory, I've checked that I have the cd flar.arc there. The abort message I get when executing this. I'll update with more info tomorrow as I am no longer at work :/ –  BitsOfNix Jan 3 '13 at 17:44
    
could it be that when loggued in you have some directory mounted, that get unmounted shortly after logging out ? (and thus your script works until it's unmounted)? And it's unclear to me why that line you show display "file unchanged" at all: this message comes from cpio? compress? but if compress, how does it know about that filename (the >... is done by the shell?) –  Olivier Dulac Jan 3 '13 at 18:35

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.