I wouldn’t consider this ‘basic’ functionality, and the Rockstor UI while very useful is still pretty rudimentary. It’s designed to accommodate for the most common needs of users.
This particular need wouldn’t be considered common.
I think that there’s an open issue regarding adding a more flexible scheduling service, but this likely won’t be addressed very soon.
The first thing that you’ll need to do is gain shell access.
If you haven’t configured SSH access for yourself, the easiest way to do this in Rockstor is via the ‘shellinabox’ plugin. I’m not next to my Rockstor box at the moment, so somebody else might need to guide you through getting this up and running, and logging into it.
Next, you’ll need to edit the crontab
file using a text editor. Typically I suggest Vim
, but if you’re not accustomed to Vim, this will have a learning curve, so instead I suggest nano
.
Edit the file by running:
sudo nano /etc/crontab
When the text editor is open, add the uncommented line to the end of the file, then write and exit.
The uncommented line is separated into 7 fields, each separated by any horizantal whitespace.
I used a lot of spaces for alignment to show you how the fields are structured, but it will be easier to write simply as:
00 17 * * 4 root /usr/bin/rtcwake -m disk -t $(date -t "9:00 Next Wednesday" +"%s")
That’s because the reboot command is a separate cron task, and cron is only fired when the system is online. Also this is not the purpose of the reboot command. It’s not “Boot an offline computer”, it’s “Restart a running computer”.
Cron is a service that runs on an online computer and monitors the clock. As the clock hits certain times, cron can be instructed to run scheduled tasks (via the crontab)
RTCWake by comparison works a little differently. It registers a “wake” command in the real-time clock of the system (RTC), and then suspends the system.
This means that the ‘wake’ command does not rely on the system being online to process cron jobs.
By running RTCWake in the manner specified in the example provided, cron only processes RTCWake to suspend the computer, cron does NOT wake the computer.
The wake is handled by the register set by RTCWake in the computer’s RTC, which will continue operating during any system suspend state.