Jump to content
Squid

[Plugin] CA User Scripts

584 posts in this topic Last Reply

Recommended Posts

I have all mine goto a Cache/SSD drive. No spin ups required. 😃

 

I have a few shares

(Uploads)

   ../incoming

   ../outgoing

(Movies)

(Tv)

 

When ever I rip a movie or tv show I always send it to my (Upload) share. Then unraid via user scripts checks that upload folder and rips thru handbrake and a few other processes and then it places it in outgoing folder which FileBot looks at and then renames things and places it either in a (TV) or (Movie) share. Mover runs in the AM when my Plex Docker spools up to check my drives for new stuff moves the files onto the Protected Array off the SSD drive. 

 

My scripts run every 30 minutes so I don't have to Babysit, but the final drop to my Array/Spinner drives are at 6AM along with Plex. 

Share this post


Link to post
56 minutes ago, M2MIT said:

Just a Quick Error, The "What is Cron" link at the bottom is broken.

It seems to always be broken.  Whenever I fix the link, it then fails in the future again.  Wikipedia has a decent writeup on cron

Share this post


Link to post

Hey all,

 

I have created my script for shutdown my server at 00 every days.

 

My Script is :

/usr/local/sbin/powerdown

 

My Custom Schedule file is :

 

# Generated cron schedule for user.scripts
00*** /usr/local/emhttp/plugins/user.scripts/startCustom.php /boot/config/plugins/user.scripts/scripts/Shutdown Schedule/script > /dev/null 2>&1

 

In my dashbord of unraid :

 

image.thumb.png.8cc1ed64f0e6ec6b7d879c0bafbd4b5e.png

 

What should I do after that? because apparently my server does not stop.

 

Thank You.

Share this post


Link to post
14 minutes ago, snake382 said:

Hey all,

 

I have created my script for shutdown my server at 00 every days.

 

My Script is :

/usr/local/sbin/powerdown

 

My Custom Schedule file is :

 

# Generated cron schedule for user.scripts
00*** /usr/local/emhttp/plugins/user.scripts/startCustom.php /boot/config/plugins/user.scripts/scripts/Shutdown Schedule/script > /dev/null 2>&1

 

In my dashbord of unraid :

 

image.thumb.png.8cc1ed64f0e6ec6b7d879c0bafbd4b5e.png

 

What should I do after that? because apparently my server does not stop.

 

Thank You.

Your custom cron is wrong. There must be spaces between each part.

Share this post


Link to post

ok thanks i will go to change this like this :

 

image.png

image.png

Edited by snake382

Share this post


Link to post

Hi all, I have done some reading and searching and can't find a clear answer.  Is there a way outside of writing it a script to get a notification that the script ran and completed successfully/failed? I use this to run some very basic rclone backups, but have no way of knowing if it ran successfully or failed.  If it did run successfully, I'd love to see the log of what was uploaded rclone puts out under the verbose command.  If it fails I'd like to know that as well so I don't assume it completed.  Is this a built in feature I am just missing?  I believe I read that it possible to get an notification, but it needs to be written in the script, but I am not familiar with writing scripts (outside of simple rclone commands).  

 

Thanks!

-Jason

Share this post


Link to post

I don't intend to have the plugin send out a notification after a script runs.

 

Rather, you'll have to do some homework, and then utilize the notify command

root@ServerA:~# /usr/local/emhttp/plugins/dynamix/scripts/notify
notify [-e "event"] [-s "subject"] [-d "description"] [-i "normal|warning|alert"] [-m "message"] [-x] [-t] [add]
  create a notification
  use -e to specify the event
  use -s to specify a subject
  use -d to specify a short description
  use -i to specify the severity
  use -m to specify a message (long description)
  use -x to create a single notification ticket
  use -t to force send email only (for testing)
  all options are optional

notify init
  Initialize the notification subsystem.

notify smtp-init
  Initialize sendmail configuration (ssmtp in our case).

notify get
  Output a json-encoded list of all the unread notifications.

notify archive file
  Move file from 'unread' state to 'archive' state.

And execute the appropriate command based upon say the exit code of your rclone command

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now