Sponsored Content
Top Forums Shell Programming and Scripting capture ftp return code..PLZ HELP Post 302164956 by ag79 on Wednesday 6th of February 2008 09:23:41 AM
Old 02-06-2008
because this:
Code:
mput $SRC_FILE 
END
quit

needs to be this:
Code:
mput $SRC_FILE 
quit
END

with your code, i think "quit" is going to the shell, and since it's not a shell command, you get a nonzero return code, eevn when ftp is done. (its just that ur ftp process will lie there)

Last edited by Yogesh Sawant; 04-03-2008 at 08:46 AM.. Reason: added code tags
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

return code on ftp if filesystem full??

Does anyone know what the return code will be if an ftp fails because the /var/tmp filesystem is full? AIX 4.3 (1 Reply)
Discussion started by: lawadm1
1 Replies

2. Shell Programming and Scripting

Capture Oracle return code in shell script

I am using the following code in my shell script list=`sqlplus -s $user/$pwd@$dbms<<EOF WHENEVER SQLERROR EXIT SQL.SQLCODE set pagesize 0 feedback off verify off heading off echo off select * from control_tbl where src_nm=$3 and extrct_nm=$4; exit SQL.SQLCODE; EOF` ERROR=$?... (1 Reply)
Discussion started by: Vikas Sood
1 Replies

3. Programming

getting the return code of forked child process (ftp)

Hi, From within my C++ program, I fork a child process and execl an ftp session (solaris), like this : std::string szStartCmd = "ftp -i -n -v 192.168.149.31"; int nExecRes = execl("/bin/sh", "sh", "-c", szStartCmd.c_str(), (char *)0); I use 2 pipes to communicate between my... (7 Replies)
Discussion started by: KittyJ
7 Replies

4. UNIX for Dummies Questions & Answers

FTP Return Code

Hi All, I have a problem to identify the error code thrown by FTP Server while uploading files. The message is : ftp return 32. I couldn't find out what is the meaning of that. :confused: OS is Sun Solaris 2.10. Anyone can help? Thanks a lot (1 Reply)
Discussion started by: wilsonSurya
1 Replies

5. Shell Programming and Scripting

No return code in ftp mget script

I have a automated FTP script that gets a file using mget. I am using mget because the date will change on the file frequently. The mget works, however if I incorrectly type the file (e.g. if I want to get /dog123 and I enter /dg*) I do not receive and error code from in the FTP session. The... (1 Reply)
Discussion started by: dog123
1 Replies

6. UNIX Desktop Questions & Answers

ftp return code not working

below is my code , but for some reason the return part is not working, only file transfer is happening and no exit status is checked .please me help me to fix this code #!/bin/sh #set -vx ftp -nv sitelocation << ! user username password lcd localdir cd /remote dir mget *.* ... (4 Replies)
Discussion started by: gwrm
4 Replies

7. Shell Programming and Scripting

Comparing files and capture return code

Hi, I would like to compare 2 files, and have a return code write to a file. regardless of the files contents are the same the code should be writing to a file (if both files contents are same then return code 0). A simple example will be great :) Thanks (3 Replies)
Discussion started by: khchong
3 Replies

8. Shell Programming and Scripting

How to capture script return code?

Hi I am executing database backup via shell script (Korn). The backup log is long, but I would like to capture only the last line so I can send an email if it fails Example of failed backup (only last 3 lines) BR0056I End of database backup: bejbofoh.aff 2012-07-26 07.31.21 BR0280I... (7 Replies)
Discussion started by: nimo
7 Replies

9. Shell Programming and Scripting

How to capture 3 digit return code of ftp??

is it possible to capture the 3 digit return code of ftp commands in a local variable inside a shell script? Code: ftp remoteserver << EOFTP quote USER uid quote PASS pass prompt cd remote_directory mput file.txt bye EOFTP in the above script, if cd ... (4 Replies)
Discussion started by: Little
4 Replies

10. Shell Programming and Scripting

Script to retry FTP commands if unsuccessful and capture the failure status code.

I am using the below code to ftp file onto another server FTP_LOG_FILE=${CURR_PRG_NAME}- ${FTP_FILE}-`date +%Y%m%d%H%M%S`.log ftp -ivn ${FTP_HOST} ${FTP_PORT} << ENDFTP >> ${EDI_LOG_DIR}/${FTP_LOG_FILE} 2>&1 user ${FTP_USER} ${FTP_PSWD} lcd... (2 Replies)
Discussion started by: akashdeepak
2 Replies
FTP_SITE(3)								 1							       FTP_SITE(3)

ftp_site - Sends a SITE command to the server

SYNOPSIS
bool ftp_site (resource $ftp_stream, string $command) DESCRIPTION
ftp_site(3) sends the given SITE command to the FTP server. SITE commands are not standardized, and vary from server to server. They are useful for handling such things as file permissions and group membership. PARAMETERS
o $ftp_stream - The link identifier of the FTP connection. o $command - The SITE command. Note that this parameter isn't escaped so there may be some issues with filenames containing spaces and other characters. RETURN VALUES
Returns TRUE on success or FALSE on failure. EXAMPLES
Example #1 Sending a SITE command to an ftp server <?php // Connect to FTP server $conn = ftp_connect('ftp.example.com'); if (!$conn) die('Unable to connect to ftp.example.com'); // Login as "user" with password "pass" if (!ftp_login($conn, 'user', 'pass')) die('Error logging into ftp.example.com'); // Issue: "SITE CHMOD 0600 /home/user/privatefile" command to ftp server if (ftp_site($conn, 'CHMOD 0600 /home/user/privatefile')) { echo "Command executed successfully. "; } else { die('Command failed.'); } ?> SEE ALSO
ftp_raw(3). PHP Documentation Group FTP_SITE(3)
All times are GMT -4. The time now is 04:41 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy