LinuxQuestions.org
Help answer threads with 0 replies.
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, 08: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 08:35 PM.
 
Old 10-15-2010, 11:14 PM   #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-15-2010, 11:43 PM   #3
babecool
LQ Newbie
 
Registered: Oct 2010
Posts: 3

Rep: Reputation: 0
need help
 
Old 10-17-2010, 03: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 07:54 AM
ftp and .netrc Canis Polaris Linux - Newbie 3 11-25-2008 04:34 PM
ftp in inittab -.netrc issue svar Linux - Networking 11 10-10-2007 02:15 AM
trouble logging in to ftp with .netrc laclac01 Linux - General 1 10-27-2005 01:15 PM
How to set anscii mode in FTP using .netrc gendreau Linux - Newbie 1 08-08-2003 12:05 PM

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

All times are GMT -5. The time now is 02:39 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
Open Source Consulting | Domain Registration