1846611 Members
1566 Online
110256 Solutions
New Discussion

FTP problem

 
Fuad_1
Regular Advisor

FTP problem

Hi,

I have successfuly write script file which runs by cron to transfer files through VPN. But, the other end always says that there are some files not been transfered. Could you please help me in this.
Set goals, and work to achieve them
6 REPLIES 6
Simone Benzi_1
Frequent Advisor

Re: FTP problem

Hi,

Could you send us your script and the error message?

Thanks,

Simone
Niraj Kumar Verma
Trusted Contributor

Re: FTP problem

can you please post your script ??
Niraj.Verma@philips.com
Steven E. Protter
Exalted Contributor

Re: FTP problem

Pretty wide field here.

1) Are you sure the VPN is up at the time of transfer. These connections can be configured with time restristions.

2) If the files exceed 2 GB, you need to insure that the target filesystem accepts largefiles. In HP-UX 11.00 that requires mount instructions in /etc/fstab and the filesystem is created newfs -F vxfs -o largefiles or fsadm is used to convert the filesystem.

As always, a copy of the script and error code would make this much easier to work on.

SEP
wish I could sleep.
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Fuad_1
Regular Advisor

Re: FTP problem

This following is the script:


cd /appl/TAUT
ls CD* > files.txt
while read LINE
do
sleep 35
ftp -n hostname << EOF
user name password
type ascii
prompt
hash
put $LINE
bye
EOF
mv $LINE /home/net/backup_out
done < files.txt
Set goals, and work to achieve them
hein coulier
Frequent Advisor

Re: FTP problem

The script looks good to me. Is the other system a Z/OS ? I remember we had some strange fenomena in the past that were resolved by ptf on the mf.

Just a hint, u can also make the folowwing script :

ftp -n hostname < user name password
cd /appl/TAUT
type ascii
prompt
hash
mput CD*
bye
EOF

BTW, perhaps your problem is the space between
<< EOF. Ift should be concatenated.
A. Clay Stephenson
Acclaimed Contributor

Re: FTP problem

Your fundamental problem is that you are doing absolutely no error checking. By far, the easist method, is to use a Perl script using the Net::FTP module. The attached script will examine the status and automatically attempt a re-transmit on any file that fails.

Invoke it like this:
ftpput.pl file1 file2 file2

It will then send the files indicated. You should modify the script to suit your needs (e.g. specify a host and directory) but this should get you started. It understands .netrc conventions so that passwords do not have to be embedded.

If it ain't broke, I can fix that.