Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a computer that every 5 hours change is IP I want to make a script that will run every hours with this command -

wget -q -t 5 --output-document=- ""

and send me the ip that he is getting. how do I do this? and is it possible to do? thanks.

share|improve this question

Make sure the remote system can send mail. Create a script in cron's hourly folder.

sudo -e /etc/cron.hourly/ipcheck

The contents of the file:

#!/usr/bin/env bash
wget -q -t 5 --output-document=- "" | mailx -s "External IP Address"

Set the script to executable:

sudo chmod 0755 /etc/cron.hourly/ipcheck
share|improve this answer
thanks , where\how do I write this?? , in which language is it? – david Jan 3 '13 at 20:47
@david Um... sudo -e invokes the default editor that will create a new file (ipcheck) in the /etc/cron.hourly/ directory. It's a BASH shell script. – user8290 Jan 3 '13 at 20:51

use crontab

 crontab -e

and then add below lines

 0 * * * * wget -q -t 5 -O - ""
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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