How to set up a Cron Job on macOS to Auto Update Your IP
This guide is for advanced users only.
- Open the program Terminal found in your Applications folder
- Type in: crontab -e and press Enter.
- Press "i" on the keyboard to enter insert mode.
Then paste in the following but make sure that your API key is included.
0 * * * * curl -X POST -d 'api_key=YOUR_API_KEY_HERE' -o /dev/null https://unlocator.com/tool/api.php;For macOS 10.14 Mojave, please use the below command instead:
0 * * * * curl -X POST -d 'api_key=YOUR_API_KEY_HERE' -L /dev/null https://unlocator.com/tool/api.php;or try
0 * * * * curl --location --request POST -d 'api_key=YOUR_API_KEY_HERE' https://unlocator.com/tool/api.php;
- Once you have pasted in the above line, press the ESC key on the keyboard to exit the insert mode. Then type in ":wq" and press Enter.
- You should then see crontab: installing new crontab in the terminal, which means that the cronjob was added successfully.
From now on your IP will update every hour. Please keep in mind that if you have a laptop and bring it to a new location the IP will be updated from this location.