- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Checking FTP Transfers
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
10-13-2003 06:29 PM
10-13-2003 06:29 PM
Checking FTP Transfers
cd /appl/
ls LKL* | read LINE
ftp -n x.x.x.x << EOF
user xxxxx xxxxx
type ascii
prompt
hash
put $LINE
bye
EOF
echo $LINE
date
mv $LINE /home/backup_out
the cron is :
* 17-22 * * * /home/taut.sh >> /home/taut.log
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-13-2003 06:39 PM
10-13-2003 06:39 PM
Re: Checking FTP Transfers
remsh machine2 cat $LINE | cmp - $LINE
You can test the output of this. i.e. if there is any output, the transfer failed.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-13-2003 07:06 PM
10-13-2003 07:06 PM
Re: Checking FTP Transfers
ftp -v <
cd xxxx
lcd $CTNL_DIR
put $_FTPFILE
bye
EOF
_FTPRESULT=`grep -i "Transfer complete" $_FTPCHECK | wc -l`
if [ $_FTPRESULT = 1 ]
then
echo "FTP of XML file worked OK" | tee -a $LOGFILE
return 0
else
mailx -s "Alert from `hostname` failed to be FTP'd to xxxx at `date`"
return 1
fi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-13-2003 10:54 PM
10-13-2003 10:54 PM
Re: Checking FTP Transfers
If you have more than one file whose name begins LKL, your script will only pick up the first one.
There are a number of ways round this.
eg - use "mput LKL*" instead of "put $LINE". This is the easiest to script.
Or you could use "ls -1" to generate a list of files and process them one at a time.
--
In terms of capturing FTP session output, as per previous post, capture session output using "ftp -n x.x.x.x << EOF >LOG 2>$1" and use grep to check the log file.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-14-2003 01:57 AM
10-14-2003 01:57 AM
Re: Checking FTP Transfers
All you have to do, is
ftpput.pl file1 file2 file3 and modify the code to do the appropriate cd's and logins.
Net::FTP also recoginizes .netrc conventions so that you don't even have to put passwords in the script -- the comments are in the code.
ftpput.pl file1 file2 file3
STAT=${?}
if ${STAT} is zero, you KNOW all the file transfers were ok.