Sponsored Content
Top Forums Shell Programming and Scripting Does not exist or unreadable error in windows ftp script Post 302335884 by rechever on Monday 20th of July 2009 05:02:25 PM
Old 07-20-2009
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..
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Automatic FTP Script from windows to unix machine

Hi i need to FTP files from windows to unix(sun) machine using script. what are the scripts commands i need to use to transfer files Thanks (2 Replies)
Discussion started by: bmkreddy
2 Replies

2. Shell Programming and Scripting

FTP Unix Box to Windows Shell Script

Hello All, Could someone help me out with this? I want to incorporate this into an existing script so the output of a SAS job can be ftp'd from our UNIX box to a directory on a drive in Windows environment. Can this be done with no extra third party software? We currently use Putty for copy... (2 Replies)
Discussion started by: Jose Miguel
2 Replies

3. Shell Programming and Scripting

Shell Script to ftp from windows server

Hello All, I've to write a shell script to transfer some files to/from windows server. I can put & get files simply by doing ftp but need to automate this. So I tried for this -. HOST=.hostname USER='username' PASSWD='***' ftp -n $HOST <<END_SCRIPT quote USER $USER quote PASS... (8 Replies)
Discussion started by: shilpa.rajput
8 Replies

4. Shell Programming and Scripting

FTP from Linux to windows server by shell script

Hi, Please advice whether my below requirement is feasible, My requirement : Automated FTP from linux server to windows server using a shell script on every monday. If feasible, please help me how to do this ? Thanks in advance (2 Replies)
Discussion started by: apsprabhu
2 Replies

5. UNIX for Advanced & Expert Users

Executing shell script from Windows FTP

Hello, Any inputs on the possibility of executing a shell script on unix box from Windows FTP TIA (1 Reply)
Discussion started by: B2BIntegrator
1 Replies

6. Shell Programming and Scripting

FTP from unix shell script to windows

Hi, I m trying to connect/establish FTP from unix shell script to my PC.Below the script i have written #!/bin/ksh ftp -v -n ddcappip01.com << "EOF" user Amit jason bye EOF ------------------------------ERROR-------------------------- but i m getting the below error for the... (4 Replies)
Discussion started by: ali560045
4 Replies

7. Shell Programming and Scripting

file does not exist or unreadable in an FTP script

I will appreciate any help with this... I have a file in this directory that looks like: this 07210900.SUP, I am getting the following error: Activities for Tue Jul 21 07:29:14 EDT 2009: File 07210900.SUP does not exist or unreadable End of activities The idea is to capture the file in... (1 Reply)
Discussion started by: rechever
1 Replies

8. UNIX for Advanced & Expert Users

Shell script to ftp files from windows to unix

Hi , I need to ftp some input files from windows to unix server.All the files will be saved in the C drive in my machine.Currently all these files are transferring manually to the unix server.I need to write a shell script which ftp the files from windows to unix box.When I searched in the forum i... (1 Reply)
Discussion started by: kavithakuttyk
1 Replies

9. UNIX for Advanced & Expert Users

ftp in shell script from linux to windows XP

Hi, I have 9 different linux based servers and i am automating there healthcheckup by doing ssh and fetching deviations out of it in a single text file. I am doing so by using ssh keygen. I am done with the above part . Now i want to ftp that text file to my windows XP desktop and i want to... (4 Replies)
Discussion started by: gemnian.g
4 Replies

10. UNIX for Advanced & Expert Users

Isql and If Exist syntax error in UNIX script

Hello Everyone, Coming again for your help to solve the below error: In a script, i had created a temp table (Temp_table) and loaded the data in it using bcp command (performed successfully) and I wanted to move it to the preferred table (called Main_table) for further use. hence I have added... (7 Replies)
Discussion started by: Suresh
7 Replies
All times are GMT -4. The time now is 02:12 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy