Cron Command for Hitting a specific web page once an hour

joe007

Cadet
Joined
Oct 22, 2023
Messages
7
Hello Guys,
How can I make my TrueNAS CORE 13.0-U5.3,
Hit a specific web page once an hour via cron?

For Example, I want it to hit this webpage: https://mydomain.com/checkin

Screenshot_3.jpg
 

Ericloewe

Server Wrangler
Moderator
Joined
Feb 15, 2014
Messages
20,194
You need to define hit. Which HTTP request, what do you need to download and what do you need to upload?
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
...and on the assumption that "hit" just means "access," the command would be curl https://mydomain.com/checkin, and it could really run as any user you like.
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
Use user nobody and FreeBSD's native "fetch" utility.

Code:
/usr/bin/fetch -o /dev/null https://mydomain.com/checkin
 

joe007

Cadet
Joined
Oct 22, 2023
Messages
7
Use user nobody and FreeBSD's native "fetch" utility.

Code:
/usr/bin/fetch -o /dev/null https://mydomain.com/checkin
Unfortunately, it didn't work for me :\
I'm trying to get it to go to the freemyip ip update page.
The command they post on their site that should make it work is this:

Code:
(crontab -l;echo "*/21 * * * * curl \"https://freemyip.com/update?token=YOUR_TOKEN&domain=YOUR_DOMAIN.freemyip.com\">/dev/null 2>&1")|crontab -



But it doesn't really work for me either
 

joe007

Cadet
Joined
Oct 22, 2023
Messages
7
Look dude, if you want to call in sick, just call in sick. Don't pretend you're working by sending fake "activity" on the company's server. They'll understand if you need a two-week vacation. Just call them and ask. :smile:


computer-drinking.gif

A full day of "work"
Ha Ha :)
The problem is that the server is my own :)
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
You are using the UI to define that cron job, right?

Then what you should put in there as the command is:
/usr/bin/fetch -o /dev/null "https://freemyip.com/update?token=YOUR_TOKEN&domain=YOUR_DOMAIN.freemyip.com"

The code you posted would create a cron job on a plain Linux or FreeBSD system. But you do not want to create a new cron job at certain intervals, you want to run a command ...
 

joe007

Cadet
Joined
Oct 22, 2023
Messages
7
You are using the UI to define that cron job, right?

Then what you should put in there as the command is:
/usr/bin/fetch -o /dev/null "https://freemyip.com/update?token=YOUR_TOKEN&domain=YOUR_DOMAIN.freemyip.com"

The code you posted would create a cron job on a plain Linux or FreeBSD system. But you do not want to create a new cron job at certain intervals, you want to run a command ...
yes, this is exactly what I did. but for some reason, it isn't working.
(not the command - the IP update effect)
so I'm thinking. Is it possible to add a delay to the command?
Let's say it stays on the page for 5 seconds?
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
What happens when you enter that same command into a shell?
 
Top