The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
File exist checking error suigion Shell Programming and Scripting 1 07-17-2009 12:41 AM
*Error: file </tmp/srw25108193> does not exist cgege HP-UX 0 04-10-2006 04:18 AM
Does UNIX-Chmod in windows exist? izy100 UNIX for Advanced & Expert Users 2 09-21-2005 05:51 AM
Printer Error(the Object Instance Test Does Not Exist) jav_v UNIX for Advanced & Expert Users 2 09-23-2002 11:42 PM
Can Unix Co-Exist with Windows 9X on the same System? ms73eb UNIX for Dummies Questions & Answers 2 05-31-2001 11:51 AM

 
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 07-20-2009
rechever rechever is offline
Registered User
  
 

Join Date: May 2009
Posts: 20
Does not exist or unreadable error in windows ftp script

I have a file like this 07200900.SUP,in a windows directory I need to FTP this file to UNIX , the directory in unix is N:\orgs\Financial Aid\MIIS\0910\FTP
I am getting this error
miis_ftp.ELM_SUP.shl[30]: =cd orgs/"Financial Aid"/"MIIS"/"0910"/"FTP" : not found
IN THE LOG FILE
Activities for Mon Jul 20 16:44:05 EDT 2009:
File 07200900.SUP does not exist or unreadable
End of activities



Code:
#MPATH="/u02/sct/banner/banpntr";
MPATH=$BANNER_HOME;
JOBNUM=$ONE_UP;
USER=$BANUID;
LPATH="/u02/sct/banjobs/";
$CDRemoteDir='cd orgs/"Financial Aid"/"MIIS"/"0910"/"FTP" ';
ScriptName="miis_ftp.ELM_SUP.shl";
UpLoadFileName=`date "+%m%d%y"00.SUP`;
##NewName= "eluppdtop.dat" ;


RemoteHost="middfiles.XXXXX.edu";
### look at this
RemoteUser="XXXXXX_finaid";
RemotePass="XXXXX";
###CDRemoteDir= "/u02/sct/banjobs";
TMode="ascii"; # Transfer mode
EmailAddress="XXXXX@XXXXXX.edu";
LogFileName="miis_ftp.ELM_SUP_${USER}_${JOBNUM}.log";
LogFile="${LPATH}${LogFileName}";
 TodayDate=`date`;
echo "\nActivities for "$TodayDate":" >> $LogFile;
#========================================================================#
# Error Handling Function
function ErrorHandle
{
# if type is 1, then the file does not exist or unreadable
if [ $type -eq 1 ]
then
    echo "File "$UpLoadFileName" does not exist or unreadable" >> $LogFile;
    echo "Subject: Error in Running Script\n Error in uploading file script "$ScriptName".  File "$UpLoadFileName" does not exist or unreadable" > EmailMessage;
    sendmail -F "  File Upload" $EmailAddress < EmailMessage;
    rm EmailMessage;
fi
# if type is 2, then the file has zero size
if [ $type -eq 2 ]
 then
  echo "File "$UpLoadFileName" has a zero size value" >>$LogFile;
  echo " Subject: Error in Running Script\n Error in uploading file script "$ScriptName".  File "$UpLoadFileName" has a zero size value" > EmailMessage;
  sendmail -F "The eluppdtop.dat  File Upload" $EmailAddress < EmailMessage;
  rm EmailMessage;
fi
    echo "End of activities\n" >> $LogFile
# Exit the program since error occurred
exit 1;
}
#========================================================================#
# Change the directory to one contains the file to be transported
##cd $LocalDir;
 cd  $CDRemoteDir;
# Do an -r command on the desired file ensure that the file exist and readable
if [ ! -r $UpLoadFileName ]
then
        type="1";
        ErrorHandle;
fi
# Do an -s command on the desired file ensure that the file exist
# and is not null
if [ ! -s $UpLoadFileName ]
then
        type="2";
        ErrorHandle;
fi

#========================================================================#
# Initiate the FTP process
# Loop through remaining parameters to create ftp commands.
(
# Enter user-name and password in host machine
echo "user $RemoteUser $RemotePass"
# Set transfer mode
echo $TMode
# Change directory in host machine
echo ${CDRemoteDir}
# Change local directory in local machine
echo lcd $LocalDir
# Transfer original file name
echo put $UpLoadFileName
# End ftp session
echo quit
) | ftp -vin $RemoteHost >> $LogFile
# End of FTP Process
#========================================================================#


Last edited by rechever; 07-20-2009 at 06:15 PM..
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 01:16 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0