0

man page for wget says

NAME
   Wget - The non-interactive network downloader.

DESCRIPTION
   Wget is non-interactive, meaning that it can work in the background,
   while the user is not logged on.  This allows you to start a retrieval
   and disconnect from the system, letting Wget finish the work.  By
   contrast, most of the Web browsers require constant user's presence,
   which can be a great hindrance when transferring a lot of data.

wget is an example of non-interactive program I know. Now my question is,

  • How can wget be used without user logged on?
  • How does non-interactive programs work?
4
  • 2
    Can you elaborate on what you actually want to do. As is, the question seems somewhat vague. – mikewhatever Mar 11 '13 at 1:24
  • 3
    Also, I think that if you read the information in the description section, your question will be already answered. – Lucio Mar 11 '13 at 1:25
  • I have to agree Lucio. The answer is in the question under the wget description. – hookenz Mar 11 '13 at 1:42
3

How can wget be used without user logged on?

By including the wget command in a daemon/service or a program where you as a user do no initiate the download.

How does non-interactive programs work?

When you create a deamon and have this daemon active it can continue to probe a server and ask for a download. If the servers is dead the non-interactive program will continue when the server is back up without any need for the user to act.

Updating Ubuntu, for instance, can be done without any action from a user and even without logging in.

0

For me the easiest way of running things while you are not logged in is by including a line in your crontab file:

# m h  dom mon dow   command
*/30 * * * * test -x /home/koju/bin/yourscript && /home/koju/bin/yourscript

The test is there to not to have cron complain via email when yourscript cannot be found. For the format of the first fields look at man 5 crontab.

From yourscript you call wget, since it is non-interactive it will not prompt you to interact by asking for input. As long as the command line options of wget get you the information you need, the above set up will run for you every 30 minutes.

Of course you should test yourscript by starting it by hand, before committing it to run on a regular basis. You might find that wget is not powerful enough to do what you want, especially on web pages that require user-interaction above the basic login.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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