Operating System - HP-UX
1830898 Members
3070 Online
110017 Solutions
New Discussion

trying to ftp a file from unix to NT

 
SOLVED
Go to solution
Patrice Blanchard_2
Frequent Advisor

trying to ftp a file from unix to NT

Hi,

i'm doing an ftp between UNIX and WINDOWS NT but when i do my put, i have an error in the ftp.log where it saying:

"gotdate.txt: Access is denied."

but my file is: "-rw-rw-rw-"
and the owner is: "bsp:bsp"

here is my script to ftp the file:

cd /wri

date > gotdate.txt
chown bsp:bsp gotdate.txt
chmod 666 gotdate.txt

ftp -i -n 10.10.198.9 > /wri/ftp.log << -EOF
user login password
cd \TimeSync
ascii
put gotdate.txt
bye
EOF

what is wrong with the file?

thanks

Patrice
18 REPLIES 18
Steven E. Protter
Exalted Contributor
Solution

Re: trying to ftp a file from unix to NT

I would change:
ftp -i -n 10.10.198.9 > /wri/ftp.log << -EOF
user login password
cd \TimeSync
ascii
put gotdate.txt
bye
EOF

To

ftp -i -n 10.10.198.9 > /wri/ftp.log <user login password
cd \TimeSync
ascii
put gotdate.txt
bye
EOF


I don't know what that dash was doing there, but it might not be helping.

SEP
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
Massimo Bianchi
Honored Contributor

Re: trying to ftp a file from unix to NT

hi,
manually it works?

Sounds like a permission problem in thw writing on the file on the window side.

Direction is UNIX -> WINDOW ?

Massimo
Patrick Wallek
Honored Contributor

Re: trying to ftp a file from unix to NT

Are you 'put'ing the file to the NT machine or the Unix machine? I would suspect that the error isn't with reading the file, but writing it at the destination. Make sure you have appropriate permissions in the \TimeSync dir on your destination. You might also want to make sure that the file doesn't exist at the destination. If it does, you might want to check its permissions / rights there (ie. make sure it isn't read-only).
Patrick Wallek
Honored Contributor

Re: trying to ftp a file from unix to NT

Stephen,

The -EOF allows the ending EOF to be preceded by a single TAB character. This allows you to make the script a bit prettier. But since the Forums eliminate all leading spaces, we can't see exactly what her script looked like.
Patrice Blanchard_2
Frequent Advisor

Re: trying to ftp a file from unix to NT

thanks but i did not change anything. I still have the error on the file.

regards
Patrice Blanchard_2
Frequent Advisor

Re: trying to ftp a file from unix to NT

I'm doing a put from UNIX to NT. The ftp script is on the UNIX server. It does not work manually. the IP address is the one of the NT server.

Do i need to set something in FTP to be able to read the file?

regards

Patrice
Massimo Bianchi
Honored Contributor

Re: trying to ftp a file from unix to NT

Check on the NT side, if the FTP serveris allowing you to chdir to the one you specified, this is the most common cause of problems.


untill it won't work manually, do not think of having the script working. It looks good, so there must be other config that you are missing, probably on thw window side.

Massimo
Steven E. Protter
Exalted Contributor

Re: trying to ftp a file from unix to NT

Thanks for the clarificaiton on the -EOF

Learn something new every day here, lately from Patrick.

Massimo is right, since the script is not an issue, it must be permissions on the NT side.

Get on the NT box, and find the file.
Right mouse properties, security.

You might see the problem.

SEP
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
Patrick Wallek
Honored Contributor

Re: trying to ftp a file from unix to NT

OK, I made a slight mistake in explaining the '-' in the script. The - is actually after the << characters. The syntax is '<<- EOF' with a space between the - and the EOF.

The functionality is the same. Just some slight confusion on my part earlier. Must've not had enough coffee yet.
Helen French
Honored Contributor

Re: trying to ftp a file from unix to NT

A possible try:

Check if the user account you are using to log in to the Windows NT system is a local or a domain user. Change the user name with a domain name (or computer name/work group name) in front of it:

'my_domain/user' instead of 'user'
Life is a promise, fulfill it!
Patrice Blanchard_2
Frequent Advisor

Re: trying to ftp a file from unix to NT

Well, i've looked on the NT side and all looks ok. I even tried with the NT administrator's login and it does not work. But to pick your brains, the get command from Unix to NT is working but the get command from NT to Unix is not.

Let me ask you this, all i'm trying to do is sync the time of the NT server with the time on the Unix server. We're trying to do this without paying a 3rd party software. I've tried FTP from NT to UNIX, FTP from Unix to NT, same error on both side (file.txt: access is denied).

Do you have any suggestions on this?

thanks

Patrice
Patrick Wallek
Honored Contributor

Re: trying to ftp a file from unix to NT

What version of Win NT are you using? Does it have an NTP client built in? If so you can use that and it will be much less painful than what you are trying to do.
Helen French
Honored Contributor

Re: trying to ftp a file from unix to NT

For time synchonization, you can use NTP. It is free, relaible and configuration is easy:

# man xntpd

Not sure how you can achieve this through ftp though ...
Life is a promise, fulfill it!
A. Clay Stephenson
Acclaimed Contributor

Re: trying to ftp a file from unix to NT

I thought this was a strange request. You need to implement NTP. You can set up NTP (Network Time Protocol) using SAM and then there are many free NTP clients for windows. A Google search should turn up tons of them -- pick one you like.

NTP will then maintain time across hundreds of boxes to within a few milliseconds. You can use an Internet time source that will sync to some very accurate time sources and even automatically compensate for transmission delays.

Look in /usr/share/doc/NTP_Primter.txt to get started.

If it ain't broke, I can fix that.
A. Clay Stephenson
Acclaimed Contributor

Re: trying to ftp a file from unix to NT

I suppose that I should add that a rather popular choice for Windows NTP clients is "NetTime". Once you start using NTP, you will never do it any other way.

http://nettime.sourceforge.net/

If it ain't broke, I can fix that.
Patrice Blanchard_2
Frequent Advisor

Re: trying to ftp a file from unix to NT

thanks all, i'll check with my admin for this.

regards

Patrice
malay boy
Trusted Contributor

Re: trying to ftp a file from unix to NT

Hi ,
Please get me right if I'm wrong.

If you want to ftp to NT,you need ftp server running on the NT.

Am I right ?.

Without additional software you can't do it...

I think ??? Again corrent me if I'm wrong.

If wrong,forgive me because I think I have a fever.....my brain is quite warm now.

regards
mB
There are three person in my team-Me ,myself and I.
D Block 2
Respected Contributor

Re: trying to ftp a file from unix to NT

Hi Patrice,

on the NT side, check the events or services log file. maybe this might lead a clue.

if you are using a Domain name, check to see that your 'user' account is like a Power user or an Administrative user. Check with your NT administrator, and verify all the objects/attributes of your user account within the 'domain controller'.

Golf is a Good Walk Spoiled, Mark Twain.