LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Red Hat 5 " tar: error exit delayed from previous errors" (https://www.linuxquestions.org/questions/linux-newbie-8/red-hat-5-tar-error-exit-delayed-from-previous-errors-584288/)

brettreyu 09-12-2007 07:28 PM

Red Hat 5 " tar: error exit delayed from previous errors"
 
I searched in the forums before posting but nothing that was specific to the problem I am experiencing.

I wrote a simple little bash script to create a tar ball of a directory and then copy that tarball to another directory. This is what my script looked like right before I received the error message

Quote:

#!/bin/bash

TODAY=$(date)

tar cjvf /tmp/twiki$TODAY.tar.bz /var/www/html/twiki/data

cp /tmp/twiki$TODAY.tar.bz /mnt/backups/twiki$TODAY.tar.bz

echo "all done"
Now it always returns "tar: error exit delayed from previous errors". Before when I wasn't using $TODAY or $(date) everything was fine. Even when I try and tar the folder manually I get the same error.

Any advise?

Tinkster 09-12-2007 07:33 PM

The problem is with the date format. Tar won't like the spaces.
Try something like
Code:

#!/bin/bash

TODAY=$(date "+%Y%m%d")

tar cjvf /tmp/twiki$TODAY.tar.bz /var/www/html/twiki/data

cp /tmp/twiki$TODAY.tar.bz /mnt/backups/twiki$TODAY.tar.bz

echo "all done"




Cheers,
Tink

jailbait 09-12-2007 07:35 PM

"tar: error exit delayed from previous errors"

tar doesn't quit on the first error it hits. It tries to find as many errors as possible. When you get the error exit delayed message it means that it has found as many errors as it could and now gives up.

The error message pertinent to your problem should appear somewhere between the tar command and the error exit delayed message.

---------------
Steve Stites

brettreyu 09-13-2007 11:04 AM

TODAY=$(date "+%Y%m%d") fixed the issue thanks! Also thanks for the tip about tar reporting errors.

Tinkster 09-13-2007 01:42 PM

Quote:

Originally Posted by brettreyu (Post 2890773)
TODAY=$(date "+%Y%m%d") fixed the issue thanks!

Cool. Glad it works now :}



Cheers,
Tink


All times are GMT -5. The time now is 06:25 PM.