Hifi Server Compile/Update and run CRON Job script


#1

This is a forked version of @Coal’s script to compile/update and run HiFi stack on CentOS 7 automatically via cron though there is no reason why it wouldn’t work on other flavours of Unix/Linux,
Please Note that it is complimentary to the original scripts and may not work standalone, and is not suitable for first run use on a clean system.

you can download the script locally to your server and have cron run it nightly (adjust the crontab entry to change this according to your preference)

Download the script to /root

cd /root  
wget https://raw.githubusercontent.com/ronlaws86/hifi-cron/master/cron-hifi.sh

Set script to be executable

chmod +x /root/chron-hifi.sh

add the following line to the crontab so it will be executed by crond
( nano /etc/crontab )

0 4 * * * root /root/cron-hifi.sh

this is set to fire off at 4am every day.

ctrl-o , return to save then ctrl-x to exit nano


Optional (and untested)

If you prefer, you can enter the cron command as a curl command directly in to the crontab instead of downloading the script and running it locally under /root though i have not tested this.

nano /etc/crontab

0 4 * * * root bash <(curl -Ls https://raw.githubusercontent.com/ronlaws86/hifi-cron/master/cron-hifi.sh)

Log files

the log files this script creates (for troubleshooting) are

  • /usr/local/hifi/logs/
    • last_compile.log (Output of make)
    • cron_log.log (Status messages with timestamps)

As always, any improvement suggestions are welcome, hope you find it useful!


#2

I love this, and here’s why… sooner or later, someone’s going to plug some vulnerability or some such.

I’m going to forget that I have a server running in Digital Ocean (or, later, on a local CentOS 7). And I’ll go DAYS while busy on other things, like, oh, my day job… and completely forget to pay any attention to what’s going on with High Fidelity and the domain-server.

This is going to put on fresh underwear for me every day they’re needed, without me knowing whether they needed to be changed.


#3

Oh - and I run mine at this time instead…
20 4 * * *

…because… duuuuuude.


#4

KDOgg, your underwear really does need to be changed every day.
That goes for the rest of you too!