Writing my public IP to Dropbox, Cronjob

Hello. I want to achieve this:

1.) Finding my public IP. I have this and it works perfectly:

wget http://ipecho.net/plain -O - -q ; echo

2.) I need to write this in a dropbox folder (let's say /home/myusername/dropbox).

3.) Put this script in a cronjob for repeating this every 10 minutes.

Can you help me with 2.) and 3.) steps? Thank you very much!

---------- Post updated at 03:14 PM ---------- Previous update was at 02:54 PM ----------

My step 2:

wget http://ipecho.net/plain -O - -q > /root/Dropbox/IP/ip3.txt

---------- Post updated at 03:24 PM ---------- Previous update was at 03:14 PM ----------

My step 3.)

Type crontab -e command:
 crontab -e
Append following job:
 15 * * * * /path/to/script.php

Thanks anyway. :slight_smile:

You could put that step 2 of yours into your crontab; for the syntax see man crontab .
Why don't you use a dynamic DNS service?

1 Like

Thank you, figured that out but I want it inside a script.

Why Dropbox and not DynamicDNS? Because I like to live dangerously! XD :slight_smile:

No, I wanted to learn something new. :slight_smile:

Thank you.