1849025 Members
4523 Online
104041 Solutions
New Discussion

Re: file transfer

 
SOLVED
Go to solution
subhashni
Regular Advisor

file transfer

Hello,
I have been using ftp (auto login ) successfully in my box to transfer file to another box. But some how when i use ftp in startup script the auto login is failed .Any idea?
Appreciate it.
unix4me
8 REPLIES 8
IT_2007
Honored Contributor
Solution

Re: file transfer

Add set -x at the beginning of the script and run so that you can see where it fails.
Jonathan Fife
Honored Contributor

Re: file transfer

The startup script for a user login, or a startup script upon boot?

Could be that the network services aren't fully initialized yet when your script runs if you're doing it on boot. What error is it giving?
Decay is inherent in all compounded things. Strive on with diligence
Steven E. Protter
Exalted Contributor

Re: file transfer

Shalom,

Startup scripts have no envirnment other than what you set.

in the startup script right before your failed line:

env > /tmp/startup.env.txt

from a regular command line:

env /tmp/regular.env.txt

diff /tmp/regular.env.txt /tmp/startup.env.txt

You will now see what environment may be needed to make your command work. Note that it probably has something to do with the PATH variable.

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
spex
Honored Contributor

Re: file transfer

Hi,

In the script, make sure you are using the absolute path to every binary. For example, '/usr/bin/ftp' instead of 'ftp'.

PCS
subhashni
Regular Advisor

Re: file transfer

Thanks so much for all your answers. it looks like when i use the ftp within the script ....it is not parsing the .netrc file.please advice.
unix4me
IT_2007
Honored Contributor

Re: file transfer

If your script is not too big, please post here.
Dave La Mar
Honored Contributor

Re: file transfer

".it is not parsing the .netrc file.please advice."==> If the user kicking off the script is not the owner of the .netrc and/or it is not in the home path, it will not parse the correct .netrc.

Regards,

-dl
"I'm not dumb. I just have a command of thoroughly useless information."
Bill Hassell
Honored Contributor

Re: file transfer

.netrc has a very exact format:

machine xxxx login yyyy password zzzz

The keywords (machine login password) must be spelled correctly. But most important, the .netrc file must:

1. in your $HOME directory
2. Owned by your userID
3. Permissions MUST be 600 or 400.

And rather than test using your script, just use the ftp command by itself. When the file is working correctly, ftp will immediately login, no user or password requested.


Bill Hassell, sysadmin