Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Schedule Task to Execute URL

Featured Replies

Would anyone be able to tell me if scheduling a cron job to fire off a URL is possible in unRAID?  If so, would anyone be able to show me how to do so?

 

Thanks!

Would anyone be able to tell me if scheduling a cron job to fire off a URL is possible in unRAID?  If so, would anyone be able to show me how to do so?

 

Thanks!

what do you mean by fire off URL? You want to open a web page on a unRaid server or a local workstation?

Yes it is possible.

 

Use "at" and "wget".

  • Author

By firing off a URL I mean connect to a web page on the Internet that may run some code.

 

Basically my shared web hosting charges a lot for scheduled tasks so I thought I could run these from unraid.

By firing off a URL I mean connect to a web page on the Internet that may run some code.

 

Basically my shared web hosting charges a lot for scheduled tasks so I thought I could run these from unraid.

 

Thanks for explaining. I figured it would be some form of wget. I just didn't get why a web page. BRiT saw it right away.

  • Author

Thanks for the info guys.  Being a windows guy I am not really sure how to set this up. Any clues? 

 

What do I do with wget and at? 

How do I set up a schedule?

Cron is the scheduler in linux. There are a few examples in the forum.  Depending on how often you want to run will determine the exact command.  Here is a example of a weekly backup set up in cron. http://lime-technology.com/forum/index.php?topic=18238.msg163989#msg163989

 

Wget provides a means to dlownload files from the web or to be more accurate...GNU Wget 1.11.1, a non-interactive network retriever. I got that right from the app.

 

Get a telnet window going on your server and type "wget --help" to see all the options.

 

I'm not sure where AT is getting used but its a command line scheduler. Look up AT and ATRM..they go hand in hand.

 

I would start with wget, script the job you want to run. Once you have that you'll just have to add it to the go file so it gets imported to cron on reboots. Trust me it sounds harder than it is. Give it a crack and post when you get stuck.

 

 

had a DUH moment...At would be used instead of cron.  :-[ 

  • Author

Ok, I think I have most of it figured out.  There was another post that basically did the same thing.

 


#!/bin/bash

# Extract root's crontable. 
crontab -u root -l | grep -q "/boot/scripts/scheduler.sh" > /tmp/crontab.tmp

grep -q "/boot/scripts/scheduler.sh" /tmp/crontab.tmp 1>/dev/null 2>&1
if [ "$?" = "1" ]
then

# Append new entries to root's crontable
cat <<-EOF >> /tmp/crontab.tmp
# Schedule wget :
#59 * * * * /boot/scripts/scheduler.sh >/dev/null 2>&1
EOF

# Update root's crontable.
crontab /tmp/crontab.tmp -u root

# If we don't copy the new crontab to "root-", the additions will be deleted
# if you use the management interface to make any changes.
cp /tmp/crontab.tmp /var/spool/cron/crontabs/root-

fi

rm /tmp/crontab.tmp

 

So then in scheduler.sh, I have a bunch of wget to the websites I want to fire off at the 59th minute of every hour (just an example).

 

So to get this to stay active on a reboot, could I just add "/boot/scripts/cron_web_scheduler.sh" in the GO file?

 

Is there a quick way to see what cron jobs are active, and a way to easily remove jobs?

Your well on your way..

 

add to go file to run on reboot. Make sure the script is executable.

 

ls -l inside the scripts folder to verify this.

 

If we deconstruct the start of the script you posted you can see how to list crontab for root.

crontab -u root -l

 

type crontab from shell and you'll get this.

 

crontab 2.3.3

crontab file <opts>  replace crontab from file

crontab -    <opts>  replace crontab from stdin

crontab -u user      specify user

crontab -l [user]    list crontab for user

crontab -e [user]    edit crontab for user

crontab -d [user]    delete crontab for user

crontab -c dir      specify crontab directory

 

 

 

Archived

This topic is now archived and is closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.