LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 09-08-2009, 05:43 AM   #1
Fill
Member
 
Registered: Jun 2007
Posts: 96

Rep: Reputation: 16
Using .wgetrc settings


Hey,

I want to make a wget cron job that sends an http request to a server each 15 minutes. However, this HTTP request requires a username and a password. So it would be something like this:

Code:
wget --http-user=USERNAME --http-passwd=PASSWORD blah blah blah
As all of you know, this would end up showing the username and password on ps.

I've been trying to find out a way on how to bypass this and I read about .wgetrc. My idea is to create a specific username on my box to use the .wgetrc file on his home directory, which will be obviously chmoded to 600, where I can put the username and password.

Now, my question is: when I use wget command, how do I say that I want it to read the user's .wgetrc file? If I had a username and password saved on a .wgetrc file, how would I tell to wget to read them from that file?

Thanks in advance,
Fill
 
Old 09-08-2009, 05:58 PM   #2
blackhole54
Senior Member
 
Registered: Mar 2006
Posts: 1,896

Rep: Reputation: 61
Couldn't you just use a cron entry of

Code:
su $wgetuser -c "wget  blah blah blah"
Where $wgetuser is the account containing your .wget file?

Depending on what environmental variables are involved, you might need to use the dash option with su to do a full login. (In that case, make sure /etc/profile and ~/.bash_profile don't write anything to stdout or stderr.)
 
Old 09-09-2009, 04:24 AM   #3
Fill
Member
 
Registered: Jun 2007
Posts: 96

Original Poster
Rep: Reputation: 16
thanks for your answer. I did that and it is now working.
 
  


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
How to reset monitor settings to default autodetected settings in openSUSE? chengas123 Linux - General 2 09-17-2008 12:24 PM
X keyboard Settings differ form GNOME settings dasy2k1 Linux - General 1 03-12-2008 09:22 PM
Network settings / DNS Server settings uid0sd Linux - Newbie 3 02-22-2007 04:39 PM
Mandrake 10.0 Gnome/KDE Taskbar icon settings...are there settings? LiquidRezin Linux - Newbie 2 03-22-2004 10:27 AM
Changing US keyboard settings to Spain (SP) settings or Mexico. zLinuxz Linux - General 4 12-01-2002 01:49 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 03:19 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