Script working successfully only when executed twice
Guys,
i am facing a very strange issue, my code below does an ftp to server A and gets a file to Server B, once the file is in B an if condition is present to check if the pattern of the filename is ABC* then it has to be encrypted using OPENSSL as ABC.enc else if it of pattern 123* has to be encrypted in a different way.
My issue is that the script has to be executed twice to get the expected result. The First execution itself does not perform the encryption. This occurs for files of large and small size.
the getfile_encrypt.ksh just performs an FTP and gets the file.
when i execute the script, i get the following
Please let me know why the script is exiting half way the first time and the second time it is executed, it runs successfully eventhough i do not make any change. eventhough it says ABC* does not exist the first time, it is present in the local path of the server B.
Hi ,
I have written a shell script to call a java program say load_id.sh .This sh script indeed is executed implicitly in other sh script which calls 2 more sh scripts one by one. I need to check if the load_id.sh (which calls java program) is executed successfully only then continue with... (1 Reply)
Hi,
maybe I'm asking a VERY dumb question, but would anybody out there tell me, why this f****** script won't work if executed as a cronjob, but works fine if executed from a shell prompt?
#! /bin/bash
set PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
date >>... (3 Replies)
Hello,
I have written a command n shell script :
srvctl relocate service -d t1 -s s1 -i i1 -t t1 -f
If the above command executes successfully without error I need to echo
"Service relocated successfully
and If it errors out I need to trap the errors in a file and also need to make... (1 Reply)
Hi,
I have two scripts viz
and
I am running them in background.
I wish to know if both the scripts completed execution successfully.
So this is what I have done
/tmp/commet/bin/connectdb1.sh &
condb1=$?
/tmp/commet/bin/connectdb2.sh &
condb2=$?
However, I am getting error... (7 Replies)
Guys,
How can we know whether a script has been executed successfully or not ?
We dont have any log directories, and we are not given a chance to modify the script. Could someone help me out with this Thanks (2 Replies)
Hi
Script not getting executed via cron but executes successfully when executed manually. Please assist
cbspsap01(appuser) /app/scripts > cat restart.sh
#!/bin/ksh
cd /app/bin
date >>logfile.out
echo "Restart has been started....." >>logfile.out
date >>logfile.out
initfnsw -y restart... (3 Replies)
Hi
I have created a perl script & running it using Linux machine. I want my script to die when system command is unsuccessful but script is dying even when system command gets executed successfully. :wall:
I am using the command below :-
system($cmd) || die "FAILED $!";
print "Hello";
... (2 Replies)
Hi everyone,
when executing this command in unix:
echo "WM7 Fatal Alerts:", $(cat query1.txt) > a.csvIt works fine, but running this command in a shell script gives an error saying that there's a syntax error.
here is content of my script:
tdbsrvr$ vi hc.sh
"hc.sh" 22 lines, 509... (4 Replies)
Hi,
I have an application where if it runs indivisually could able to execute commands (like system("ls")) and could able to execute tcl script.
Same application if started from health monitor process (From health monitor process my application will be forked), it could not execute the... (1 Reply)