small error in shellscripting -archival part


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting small error in shellscripting -archival part
# 1  
Old 10-14-2011
small error in shellscripting -archival part

Hi All,

I have run the below script but getting one small error. please help me to solve this.

ERROR:
Code:
tar: Error exit delayed from previous errors

CODE:
Code:
#! /bin/bash
CEP=/home/user01/exercise/CEP
ARCH=/home/user01/exercise/archive
LOG=/home/user01/exercise/logs
#################### initialization
# Archival date
if [ `date +%a` = "Mon" ]; then
        let arc_date=`date +%Y%m%d --date='3 days ago'` # friday
else
        let arc_date=`date +%Y%m%d --date='yesterday'`
fi
#################### archive previous files
mkdir -p $ARCH/$arc_date
if [ "$?" -eq "0" ]; then
        tar -Pczf $ARCH/${arc_date}/${arc_date}.tgz $LOG/*.log $CEP/*.log.* $CEP/Adapter/*.csv $CEP/*.csv
rm -rf $LOG/*.log
rm -rf $CEP/*.csv
rm -rf $CEP/*.log.*
rm -rf $CEP/Adapter/*.csv
fi


Thanks
# 2  
Old 10-14-2011
It means what it says. tar had errors earlier.

What were these earlier errors?
# 3  
Old 10-14-2011
No any other errors

got some below errors but other errors are due to non avaibilty of files
but my question is why their is tar: Error exit delayed from previous errors
?

Code:
tar: /home/user01/exercise/logs/*.log: Cannot stat: No such file or directory
tar: /home/user01/exercise/CEP/*.log.*: Cannot stat: No such file or directory
tar: /home/user01/exercise/CEP/Adapter/*.csv: Cannot stat: No such file or directory
tar: /home/user01/exercise/CEP/*.csv: Cannot stat: No such file or directory
tar: Error exit delayed from previous errors

# 4  
Old 10-14-2011
Quote:
Originally Posted by aish11
No any other errors
Yes there were...

It means what it says; tar had errors, but kept going, and returned error later.
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Shellscripting -z option

Can someone explain the -z option in shellscripting. I did this. When I was in both ksh and bash it echoed back hi. #!/bin/ksh if then echo hi fi When I echoed $BASH_VERSION in bash it gave a version. When I echoed $BASH_VERSION in ksh it was blank. I thought -z was... (4 Replies)
Discussion started by: cokedude
4 Replies

2. UNIX for Dummies Questions & Answers

[Solved] Help -file archival

Hi All, I have a scenario to append all the CSV files with date while moving from one directory to another directory . e.g. Source DIR - A files (can be more files, not sure about file names , but csv format ) a.csv, bc.csv, el.csv,... Target Dir - B I want my file names as ... (16 Replies)
Discussion started by: AspiringD
16 Replies

3. Shell Programming and Scripting

Small Error while copying

Hello Gurus, I am getting an error when i am running the below script: # cat test #!/bin/bash ti=/home ls -1rt /home/jinny/html > /tmp/apafiles xargs cp -R -t $ti/ji < /tmp/apafiles cp: cannot stat `smscconf_lra.html': No such file or directory cp: cannot stat... (3 Replies)
Discussion started by: hitesh1907
3 Replies

4. Shell Programming and Scripting

Timeout in shellscripting

#!/bin/sh for ip in $(cat /root/Desktop/ftp.txt) do HOST=$ip USER='bob' PASS='bob' ftp -n $HOST <<EOF user bob bob EOF echo "$ip" done the Above code i want to use check and verify login works on multiple ftp servers on my network. However the ftp servers are dynamic in setup... (5 Replies)
Discussion started by: Noledge
5 Replies

5. Shell Programming and Scripting

New to shellscripting error: ./emailnotifications.sh: line 43: [: FH: integer expression expected

Hi , I'm a beginner in unix shell scripting need help in rectifying an error Source file :test.txt with Header ------ ----- Trailer ex: FH201010250030170000000000000000 abc def jke abr ded etf FE2 I was validating whether the header begin... (2 Replies)
Discussion started by: dudd9
2 Replies

6. Shell Programming and Scripting

New to shellscripting....need some help!

I have 3 shell scripts below.... I need to write a command line parser for these 3 utilities. basically the parser will accept ANY number of commands in this syntax -r = right -f = findtext -c = count so you do something like mu.s -r 3 4 5 -f hello goodbye.txt -c *.c -h 5 4 3 right... (5 Replies)
Discussion started by: TurboArkhan
5 Replies

7. Shell Programming and Scripting

Shell - a small error! :(

# doloadsfs.sh - load scribe data into new SFS files for s in c e f h m do for f in 0001 0002 0003 0004 do hed -n ma$s.$f.sfs slink -isp -f 20000 c:/data/scribe/scribe/dr1/mt/ma$s/a${s}pa$f.pes \ ma$s.$f.sfs anload... (8 Replies)
Discussion started by: abrox
8 Replies

8. Shell Programming and Scripting

shellscripting question

I have been “commissioned” to write a shellscript to automate Oracle cold refeshes.. right now we perform about 20 refresh each 300gb in size which takes up our time. my goal is to write a shellscript which can be executed by a user on serverA to refresh any of the 7 databases on ServerA. I am... (4 Replies)
Discussion started by: jigarlakhani
4 Replies

9. UNIX for Dummies Questions & Answers

Archival Tool for UNIX

Hi All, Need to get the information if there is any tool on Unix for Archiving and retrival of documents automatically. Having the capbalilty to integrate with other systems. And provide the APIs which can be called from other Systems to facilitate automatic Archival and Retrieval. Thanks &... (7 Replies)
Discussion started by: sanjeev0915
7 Replies
Login or Register to Ask a Question