Custom Scripts & Cron


Recommended Posts

I have a custom script that i want to run to control the fans on my unraid host.

 

I created my script, placed it in /root, added an entry to crontab. it worked perfectly until i rebooted. where the script and crontab entry disappeared. 

 

Any advice? or tips? is there some unraid way to do this? learning how to create a plugin/create one seems overkill for this.. 

Link to comment

I tried to put the the txz file in /boot/extra (which i had to create) the file persisted after a reboot but it did not reinstall it. Am i correct to assume that it should be a slackware package file? 

 

Regarding the existing IPMI Plugin, it seems its fan control features are just for asrock & supermirco motherboards. i have a dell r510. 

 

EDIT: 
I found this really old post from 2007. 

is this still the method to add packages? 

Edited by SmurfKiller
Link to comment

The User Script plugin will work to run the script, but i still need to get ipmitool installed. 

 

I know i could check if it is installed and install it from within the script, but that just seems too messy. there has to be a better way. the unraid wiki seems to link to that post from 2007. which i am happy to use, but i just want to know if it is still the correct way to get a package to persist after a reboot. 

Link to comment
23 minutes ago, SmurfKiller said:

I tried to put the the txz file in /boot/extra (which i had to create) the file persisted after a reboot but it did not reinstall it. Am i correct to assume that it should be a slackware package file? 

 

Regarding the existing IPMI Plugin, it seems its fan control features are just for asrock & supermirco motherboards. i have a dell r510. 

 

EDIT: 
I found this really old post from 2007. 

is this still the method to add packages? 

 

Highly recommend you don't do that.  Instead you can put slackware packages in that 'extra' directory and they will get installed.

 

Another method of installing custom code is to add lines to the 'config/go' file before 'emhttp' is invoked.  For example, you can create a directory on your usb flash device called 'private' and put any packages/scripts/etc there.  Within Unraid OS, the root of the flash device is mounted at /boot and your private directory will appear as '/boot/private'.  To invoke a script store there, edit your 'go' file and add, for example,

/boot/private/my-script

 

  • Like 1
Link to comment

That old post seems needlessly complex to me. User Scripts can run a script at boot and run other scripts on schedule.

 

You can also put code in the config/go file on flash. That is a script which starts emhttp and is a commonly used place to put additional boot up code.

 

*edit* Tom beat me to it.

  • Like 1
Link to comment
Just now, limetech said:

Another method of installing custom code is to add lines to the 'config/go' file before 'emhttp' is invoked.  For example, you can create a directory on your usb flash device called 'private' and put any packages/scripts/etc there.

Thanks, that with the User Scripts plugin will do the job :)

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.