Tuesday, April 26, 2011

Put files in remote machine by FTP in background


If you have a requirement to put files from one machine to a remote machine where the client in which you are connecting might disconnect after some time out. In this case you would want the file transfer to take place in background ( in server ).Here is a small shell script which can put files in background. This is for solaris.


#!/bin/sh
HOST='remote machine ip'
USER='remote machine user name'
PASSWD='remote machine user password'


ftp -n $HOST <<END_SCRIPT
quote USER $USER
quote PASS $PASSWD
prompt off
cd /data1/oracle/rman -- source directory where your files are present
mput *
quit
END_SCRIPT
exit 0



You can check whether the process is running as shown below.


-bash-3.00$ ps -ef | grep scriptname


0 comments:

Post a Comment

 

ORA-BLOG. Copyright 2008 All Rights Reserved Revolution Two Church theme by Brian Gardner Converted into Blogger Template by Bloganol dot com