- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: retry process in ftp script...!!!!
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-10-2006 07:52 PM
12-10-2006 07:52 PM
retry process in ftp script...!!!!
SERVER=10.89.40.35
USER=xyz
PASSWD=xyz
ftp -in $SERVER<
mkdir PPL
cd /path of remote dir
lcd /path of local dir
hash
bin
put
bye
<
The above ftp script i have to schedule in crontab at a particular instance of time run daily.
In the above ftp script i have to implement a retry process.
So that in the case if the transfer is stopped in between ftp for any reasons then after a gap of 15 mins the ftp session again retry to do the ftp.
This is done so that the person at remote server where the files are to be dumped get an idea that some problem lies in connectivity if ftp fails..after a no. of retries .
PLS if anybody cld help in writin the code for it..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-10-2006 08:04 PM
12-10-2006 08:04 PM
Re: retry process in ftp script...!!!!
a couple of ideas:
1. you can check the return status of your ftp command and then rerun your ftp script
ftp
.
.
status=$?
2. you can check logfile for errors
ftp -in $SERVER << EOF > logile
3. you can compare filesizes after completion of ftp
4. We write put a start file at the beginning of the ftp script, then the datafile and finally we put a end file.
This way the receiver knows when the transfer started and that the datafile is complete, as we only transfer the end file after completing the data transfer.
Please also read:
http://forums1.itrc.hp.com/service/forums/helptips.do?#33 on how to reward any useful answers given to your questions.
So far you have not awarded any points !
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-11-2006 12:31 AM
12-11-2006 12:31 AM
Re: retry process in ftp script...!!!!
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-11-2006 02:44 AM
12-11-2006 02:44 AM
Re: retry process in ftp script...!!!!
ftpput.pl -h ${SERVER} -l ${USER} -p ${PASSWD} \
-B -d /remote_dir -t 5 file1 file2 file2
STAT=${?}
if [[ ${STAT} -ne 0 ]]
then
echo "ftpput failed. status ${STAT}." >&2
fi
and if any operation such as cd fails a non-zero exist status will be returned to the shell.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-12-2006 12:43 AM
12-12-2006 12:43 AM
Re: retry process in ftp script...!!!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-12-2006 03:45 AM
12-12-2006 03:45 AM
Re: retry process in ftp script...!!!!
I have a ftp script which will take input from a parameter file and will transfer file. You can add some condition for exit code checking and rerun the loop / function..
May be helpful to you..
---------------------------------------------
while read dest_ip dest_user dest_pwd dest_file
do
if [[ -f $dest_file ]]
then
echo "Transferring $dest_file file."
{
echo open $dest_ip
echo user $dest_user $dest_pwd
echo put $dest_file $dest_file
echo close
} | ftp -inv
check=$?
echo "$dest_file file transfer complete."
fi
done < mapfile
---------------------------------------------
the mapfile contains entries like below.
Destnation_Svr_Name/IP ftp_usr_name passwd file_2transfer