I have a pattern for filename to be searched.
I need to get the files from remote server Who are matching the file pattern.
And i need to exit with non zero return code for:
1)No files found matching that pattern
2)More than one files matching the name pattern.
If only one files is matching, then exit with zero return code.
Currently i am doing like in the below script:
But i dont think , the above is not the good approach and that may lead to ugly false negatives in some cases.
Why not capture ftp's output to see what files it retrieved?
How to process logfile depends on what its output actually is of course. FTP on my system probably doesn't look much like FTP on yours. Post a sample and we can help.
Hi,
I have ftp script like below
How to insert an error handling, If the transfer failed then send mail to me.
Actually, I just need the script to send an email if the FTP failed. How to put the email script within FTP script?
Thank You
Edy (5 Replies)
Hi all,
I have done google on the aforementioned subject. But didn't find any authentic way of checking 100% Successful FTP transaction.
In my case I have critical backup of source code on daily basis. I have shell script which will:
1: "mput" backup files to remote server using FTP
2:... (8 Replies)
Hi everyone!
I'm in a need of a shell script that search for all files in a folder, move all those files to a temp folder, and upload those files via FTP. When the file transfer via FTP completes successfully, the file is moved to a completed folder. In case any of those files fails, the file... (4 Replies)
Hello All,
How we can capture the FTP file transfer status. I would like do the exceptions handling for the FTP file transfer
My code is something like this...
ftp -nvi $FTP_SRVR |&
print -p user $UID $PWD
print -p cd mydir
print -p put $FILE_NAME
print -p close
print -p bye
... (3 Replies)
hello friends,
I am given a project to handle the command not found exception.I am using RED HAT 9. Generally, when we press a wrong command in the terminal: example :-
" $cet " in place of " $cat ". Then we get this exception. But I need to give the output as the combinations that are possible... (5 Replies)
Hi All,
How can we handle file operation in scripts. I have written a script that run ok otherwise however the "Cat" operation leaves a process open on the box. Command is like
cat "${LASTFILENAME}" | /usr/xpg4/bin/awk -F, '{do{if ($3 == "100" && $4 == "300" && $170 ~ /^abc/) {
... (2 Replies)
I have a script which connects to remote server and ftp the files
It works fine, however if there is any failure in ftp connection can it be handled???
ftp log
ftp session start time is: Thu Jun 19 00:00:02 BST 2008
Not connected.
Not connected.
Interactive mode off.
Not connected.... (1 Reply)
Hi
! /bin/sh
set logdir1 "logDir/local/logname"
#write the filename into a file
echo $logdir1 >> logname.txt
how do i exec the above echo command (1 Reply)
Hello,
A couple of times per week, i receive emails notifications when files are available for processing.
Currently i read these eamails with a java program and store the attachement on my C: drive and would now like to generate a PC script to send this file name up to UNIX-Solaris and... (3 Replies)
Hello All,
I am trying to write a script that will only continue executing my script if a file exits. I know the directory of the file, so its just a matter of seeing if the file exists yet. If the file has not yet been created, I want the script to wait 10 minutes (600 seconds) and try again.... (7 Replies)