Is there a way to pass the username and password from a file instead of the command line via --user and --password?

Background: I want to run wget via cron and don't want the username/password show up in process view

link|improve this question

75% accept rate
feedback

2 Answers

up vote 10 down vote accepted

Use a .wgetrc file (GNU manual, example) in which you can set username and passwords for either or both ftp and http.

To use the same credentials for both specify

user=casper
password=CasperPassword

or individually

ftp_user=casperftp
ftp_password=casperftppass
http_user=casperhttp
http_password=casperhttppass
link|improve this answer
1  
The GNU wget manual also suggests using the -i option and feeding the username and password in from standard input. – Richard May 8 '11 at 15:08
feedback

In many regards curl can be a better choice. Wget became a bit stale over time.

curl's -n switch can be used for this task: http://curl.haxx.se/docs/manpage.html#-n

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.