FTP - SCP


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting FTP - SCP
# 1  
Old 02-07-2012
FTP - SCP

Hi Team,

When an FTP is success, code 226 is returned.
Is there a possibility of return of code 226, when a part of file is transmitted to remote server.

SCP do not return any codes but exit with status 0. This is what i found after executing SCP with verbose option.
Is there a possibily of exit code 0 from SCP, when a part of file is transmitted to remote server.

I am trying to handle the part file transmitted errors in FTP and SCP and re-send the files if they are part transmitted.

Appreciate your responses
# 2  
Old 02-07-2012
Previous thread (which includes sample script and some replies) is:
https://www.unix.com/shell-programmin...scp-files.html

Can you tell us what Operating Systems and versions are involved?
Do you have administration rights over the target computer(s)?
Are you trying to make a choice between "ftp" and "scp" or are you trying to get both working reliably?

For automated "ftp" we usually transfer the files under a temporary file name and then rename the whole batch at the end of the file transfer (but still in the same ftp job). I have never seen a partial "ftp" where a subsequent command in that same ftp job is still executed. Tested this technique to destruction including rebooting computers, pulling the lan cable, killing processes etc. .
If your "ftp" program does not have a timeout, you need to implement a timeout process.
For dodgy networks or critical data we also create and transfer a control checksum file after the main files, then get the remote system to create a matching control checksum file, then transfer the new control checksum file back for comparison. Have used this technique for migrating large numbers of user accounts to a barely-compatible unix platform.
# 3  
Old 02-07-2012
Thanks for the reply
We are using Linux , revision 2.6.9-89.ELsmp.
I don't have administrative rights over remote systems and I am trying to get both FTP and SCP work reliably

Better FTP Methods:
1) Transfer the file under temporary file name and then rename the temporary file ( all under one FTP job )
2) Create a checksum for each file and send the checksum file to remote destination.
Processess on remote destination creates a new checksum file and compare with the delivered checksum file. If both are alike, then that file is good to go.

I think i can use any one of the above methods.
CHECKSUM for each file. But we need to check the compatability of two systems.

How about SCP? Does exit status of "0" ensures tranmission of full file.
I don't see any command under SCP to rename a temporary file.
How would i do this?

Thanks for you replies.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

FTP/SFTP/SCP Files

Hi, I have a process which FTP's the files from one server to another server. Sometimes only half or a part of the file is delivered to remote location, but on the end log says FTP is successful. But ideally file in full is not delivered to remote location. How can i catch these kind of errors... (2 Replies)
Discussion started by: forums123456
2 Replies

2. HP-UX

[Solved] Unable to rename file in ftp server .Net:FTP perl

Hello All, I am trying to connect to ftp server and get the files. Also i need to rename the file in other ftp dir. rename method is not allowing me to rename the file in other dir. When i tried copy command by using net::FTP:FILE then perl says it is not installed. Can some body help me to... (2 Replies)
Discussion started by: krsnadasa
2 Replies

3. UNIX for Dummies Questions & Answers

Ftp/scp Command Error

Hi, How to use ftp/scp command with password containing @ symbol. Ex: ftp xyz:xyz@sun@11.211.111.11:/export/backups/ Exception I got: unknown host or invalid literal address Note: I dont want to change the password. Regards, Vinodh' Kumar (5 Replies)
Discussion started by: vino_hymi
5 Replies

4. Linux

Need SCP script equivalent to FTP script .

Hi, Currently i'm using the folllowing FTP acript and its working. echo "open $server" > ftp_file echo "user $user $password" >> ftp_file echo "cd $remote_dir" >> ftp_file echo "lcd $local_dir" >> ftp_file echo "put $file">> ftp_file echo "bye" >> ftp_file ftp -nv < ftp_file I've... (1 Reply)
Discussion started by: vickramshetty
1 Replies

5. UNIX for Advanced & Expert Users

problem while doing Large file transfer thru Scp and FTP

Hi , I want to transfer one file having 6GB(after compression) which is in .cpk format from one server to other server. I tried scp command as well as FTP and also split the file then transfer the files thru scp command. At last i am facing the data lost and connection lost issue. Generally it... (2 Replies)
Discussion started by: Sumit sarangi
2 Replies

6. Shell Programming and Scripting

Automated FTP script using .netrc to multiple FTP servers

Hi all, I'm using the following script to automated ftp files to 1 ftp servers host=192.168.0.1 /usr/bin/ftp -vi >> $bkplog 2>&1 <<ftp open $host bin cd ${directory} put $files quit ftp and the .netrc file contain machine 192.168.0.1 login abc... (4 Replies)
Discussion started by: varu0612
4 Replies

7. UNIX for Dummies Questions & Answers

SCP -r from Secure FTP site

Hi all, My problem is simple. I would like to download the contents of a directory on an ftp site. I can access the site through windows, but there are many files and it would be too tedious to click and download each file. Thus, I am trying to use scp -r... (5 Replies)
Discussion started by: cpabrego
5 Replies

8. UNIX for Advanced & Expert Users

Using FTP to check whether file is completely FTP... plz find the description below

Hi, We have some clients who will place huge files in to one of the remote server. And the shell script written in our local server to retrieve client files (using FTP) placed on one of the remote server of ours by clients. My question Is there any FTP command/script to check from my local... (1 Reply)
Discussion started by: nmsrao
1 Replies

9. Shell Programming and Scripting

Replace FTP with SCP

Hi All, I was using FTP for transferring files from remotemachine. Code below: # FTP for Customercare log #************************* cd $TRACKING_LOGDIR ftp -n $CUSTCARE_SERVER << END_INPUT >> $TRACKING_LOGDIR/ftp_custcare.log 2>&1 user $CUSTCARE_USER $CUSTCARE_PWD asc cd... (3 Replies)
Discussion started by: subin_bala
3 Replies

10. Shell Programming and Scripting

Modify FTP script to have SCP

Hi, I have an existing FTP script and I am trying to modify this to do SCP rather than FTP. I checked the man help in SCP and still having a hard time doing this... Current FTP script.. ftp -n << EOF > $LOG_FILE verbose open ${SERVER} $LOGON cd ${REMOTE_FILE_PATH} get... (2 Replies)
Discussion started by: madhunk
2 Replies
Login or Register to Ask a Question