How to Set Up a Cron Job on macOS to Auto Update Your IP

This guide is for advanced users only.

1
Open the program Terminal found in your Applications folder
2
Type in: crontab -e and press Enter.
3
Press "i" on the keyboard to enter insert mode.
4
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;
	
5
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.
6
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.

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.

Still need help? Contact Us Contact Us