LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-15-2010, 09:34 PM   #1
rlitwez
LQ Newbie
 
Registered: Oct 2010
Posts: 3

Rep: Reputation: 0
Unhappy FTP script could not read from .netrc file


i wrote a script that basically ftp's to a remote machine to place some files in it.
I also setup the .netrc file in my usernames home directory so that i dont need to specify the username and password in the script.
The script works fine if i just run it. However when i put this script in cron job, the remote server wont authenticate. Almost seems like its not getting any login details which i assume should be fed from the .netrc file. Would greatly appreciate any comments please of what im doing wrong...
thanks

Last edited by rlitwez; 10-15-2010 at 09:35 PM.
 
Old 10-16-2010, 12:14 AM   #2
rustek
Member
 
Registered: Jan 2010
Location: Melbourne, IA, USA
Distribution: Ubuntu
Posts: 93

Rep: Reputation: 8
Best guess is that you are running the script as root from cron.

12 * * * * root /whatever/yourscript

Try something more like:

12 * * * * rlitwez /whatever/yourscript

If your interested in automating interactive programs, check out Expect, and get a copy of the script Autoexpect.

Good luck...
Russ
 
Old 10-16-2010, 12:43 AM   #3
babecool
LQ Newbie
 
Registered: Oct 2010
Posts: 3

Rep: Reputation: 0
need help
 
Old 10-17-2010, 04:01 AM   #4
rlitwez
LQ Newbie
 
Registered: Oct 2010
Posts: 3

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by rustek View Post
Best guess is that you are running the script as root from cron.

12 * * * * root /whatever/yourscript

Try something more like:

12 * * * * rlitwez /whatever/yourscript

If your interested in automating interactive programs, check out Expect, and get a copy of the script Autoexpect.

Good luck...
Russ
hi russ
Im setting up this cron job under my usernames crontab (not root) so i was assuming that its gonna run under my username even without specifying my username in the cron. But ive just added my username like you said but its still the same...
anyways, thanks for your comments ill also check out that Expect program...

cheers
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Auto FTP login, without .netrc, reconnect stdin rhlee Linux - General 0 08-10-2009 08:54 AM
ftp and .netrc Canis Polaris Linux - Newbie 3 11-25-2008 05:34 PM
ftp in inittab -.netrc issue svar Linux - Networking 11 10-10-2007 03:15 AM
trouble logging in to ftp with .netrc laclac01 Linux - General 1 10-27-2005 02:15 PM
How to set anscii mode in FTP using .netrc gendreau Linux - Newbie 1 08-08-2003 01:05 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:03 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration