Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - Software
User Name
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.


  Search this Thread
Old 09-08-2009, 04:43 AM   #1
Registered: Jun 2007
Posts: 96

Rep: Reputation: 16
Using .wgetrc settings


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:

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,
Old 09-08-2009, 04:58 PM   #2
Senior Member
Registered: Mar 2006
Posts: 1,896

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

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, 03:24 AM   #3
Registered: Jun 2007
Posts: 96

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


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

All times are GMT -5. The time now is 08:17 AM.

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