Sponsored Content
Full Discussion: Retry Logic But In Cron
Top Forums UNIX for Beginners Questions & Answers Retry Logic But In Cron Post 303046099 by xgringo on Thursday 23rd of April 2020 05:31:39 PM
Old 04-23-2020
Retry Logic But In Cron

Hard to explain but we get two sets of files in, and index file and image file. Often the image file arrives way later, so we just run this resubmit.sh script I'm going to show in a second.
Code:
java_dir="/apps/dwd/rip-robinprod/jar"
log_dir="/apps/dwd/logs"
log="$log_dir/resub.`date +"%m%d%y"`.log"
error_dir="/apps/dwd/rip-robinprod/work/"
ERRORFILE=`ls /apps/dwd/rip-robinprod/work/*err|wc -l`
dt=`date '+%d/%m/%Y_%H:%M:%S'`

cd $java_dir
echo $ERRORFILE

if [ $ERRORFILE -gt 0 ]; then
   sed -i 's/�/-/g' $error_dir*.rpt
   echo "The below files have been resbumitted. " >> $log
   echo `ls -ltr $error_dir*err` >>$log
   /bin/java -cp "./TIPError.jar:./TIP31.jar:./TIP31msg_en_US.jar" ResubmitErrors -AuxprpawdRobin01 -P20904 >>$log
else
   echo "No Error Files Found $dt" >>$log ;\
   exit
fi

This basically uses those jar files and tries to reconcile the files, if they don't work the files go back into a directory with the file extensions .err and rpt
Each time they do the resbumit.sh it updates the time stamp. How can we retry like 5 times and then kick out an email that this has been resumitted 5 times please notify vendor?
 

2 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Retry upon FTP failure

I am using the following code in a C Shell script to transfer files to a remote server: ftp -n logxx.xxxx.xxx.xxx.com <<DO_FTP1 quote user $user_name quote pass $password ascii put $js_file_name bin put $FinalZipFile quit DO_FTP1 This code works great except on those rare occasions... (8 Replies)
Discussion started by: phudgens
8 Replies

2. Shell Programming and Scripting

If then else - Retry operation

I need to read a file line by line, then depending on the contents of each line, type in a code that will get written to an array. The problem I have is when I ask the user to confirm the input code, if it is wrong, how do i Return to ask again? Any thing I try increments the file to the next... (6 Replies)
Discussion started by: kcpoole
6 Replies
CLEAN-BINARY-FILES(1)						   User Commands					     CLEAN-BINARY-FILES(1)

NAME
clean-binary-files - remove a third party binaries (JARs) from an upstream archive SYNOPSIS
clean-binary-files {[-f {-, instructions_file}], [-e exclusion_file] [-l]} [-a archive_file] [-d custom_jar_map] [-n] [-p] [-s] OPTIONS
-f The instructions file, specifying which files to keep and which to remove -e The exclusions file, specifying special binary files that are to be preserved, or non-binary files that are to be removed. -l Only list instructions (to put in instructions file), do not delete anything. -a Archive file on which actions will be performed, as opposed to current directory -d A custom jar map file (has priority over the generic one). -n No symlinks (i.e. only clean jars, don't run build-jar-repository afterwards) -p Preserve original file names (-p to build-jar-repository) -s Silent mode. Won't output commands during cleanup -f The instructions file, specifying which files to keep and which to remove -e - The exclusions file, specifying special binary files that are to be preserved, or non-binary files that are to be removed. -l - Only list instructions (to put in instructions file), do not delete anything. -a - Archive file on which actions will be performed, as opposed to current directory -d - A custom jar map file (has priority over the generic one). -n - No symlinks (i.e. only clean jars, don't run build-jar-repository afterwards) -p - Preserve original file names (-p to build-jar-repository) -s - Silent mode. Won't output commands during cleanup EXAMPLES
Suppose there is a vanilla tarball abc-1.tar.gz with some binary files (jars) in it. In the source repo, we would want a clean copy without any jars. We can use the scripts to achieve this: To generate an instructions file: clean-binary-files -e <exclusion file> -l -a abc-1.tar.gz > instructions This creates an 'instructions' file, which contains info on what stays and what goes. Then, one can run: clean-binary-files -f instructions -n -a abc-1.tar.gz This would create abc-1-clean.tar.gz for uploading into jpp/fedora/etc. repositories with no binary (jar) files. Alternatively, if you have a vanilla tarball, you can clean and create symlinks in it's place all at once by: clean-binary-files -e <exclusion file> -d <custom_jar_map> -a abc-1.tar.gz Note: If the -a <file> is not given to clean-binary-files(1), all actions are performed on current directory. SEE ALSO
Regular Manual Pages check-binary-files(1), create-jar-ks(1), jpackage-utils(7) Documentation Further reading should be found in clean-binary-files.txt located in your standard documentation directory. Original mail is here: https://www.zarb.org/pipermail/jpackage-discuss/2005-November/009158.html AUTHOR
Written by Deepak Bhole REPORTING BUGS
Report bugs using JPackage Bugzilla (http://www.jpackage.org/bugzilla/) clean-binary-files (jpackage-utils) 1.7.5 February 2009 CLEAN-BINARY-FILES(1)
All times are GMT -4. The time now is 11:47 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy