[Plugin] CA User Scripts


Recommended Posts

Really?!  Damn I got some catching up to do....

Man, I never hit the linux command line (beyond very very basic stuff - I'm a DOS guy) prior to just before CR was released (or wrote a line of code since I was a teenager).  Look how far you've come with the dvb plugin

 

Sent from my LG-D852 using Tapatalk

 

 

Link to comment

Errr.  You wrote that... I just maintain it.... without fully understanding how a lot of it works. :)

Fine.  I'll get you to do all the html/css for me then as that's one thing I just have a bitch of a time wrapping my head around

 

Sent from my LG-D852 using Tapatalk

 

 

Link to comment

Did some research, and due to how I handle the enabling / disabling of the buttons when running in the background, there is a limitation on what characters are allowed in the name of the folder

 

Only letters ([A-Za-z]), digits ([0-9]), hyphens ("-"), underscores ("_"), colons (":"), periods ("."), and spaces (" ") are allowed.  Anything else will mess up the background running (but will probably work in the foreground)

 

Technically, other characters would be valid, but due to the massive amount of escaping, you're best to just keep it simple.  In particular, avoid single and double quotes.  This is because of the HTML, not passing the command to bash.

 

An update will be released tomorrow which will handle spaces in the folder names (oversight on my part), after further testing.

Link to comment

Quick question:

If I close the script windows, does it actually halt the command that has already been called?

 

So I created a script that manually trigger the mover (which naturally takes a while to run). But then that's the only command so I wonder if I can simply close the script windows and the mover would continue to run.

Link to comment

Yeah it would stop the command.  You would need to run it in the background.  Aborts on background tasks will kill the running script, but if the script called a long running command at the time of abort (something like find) then that command will run to completion.

 

Sent from my LG-D852 using Tapatalk

 

 

Link to comment

Now go easy on me here as I've been awake over 24 hours pretty much...

 

I've spent an hour trying to work out where I was going wrong......

 

It won't execute the script if it's called script.sh 

Create a file called script this will be the actual script.

 

It's also on the plug page.  Everything chosen to make it easier for noobs

Link to comment

Now go easy on me here as I've been awake over 24 hours pretty much...

 

I've spent an hour trying to work out where I was going wrong......

 

It won't execute the script if it's called script.sh  :P

Create a file called script this will be the actual script.

 

It's also on the plug page

 

I'm not debating that, just telling you I made an IT10T error...  ;D

Link to comment

Now go easy on me here as I've been awake over 24 hours pretty much...

 

I've spent an hour trying to work out where I was going wrong......

 

It won't execute the script if it's called script.sh  :P

Create a file called script this will be the actual script.

 

It's also on the plug page

 

I'm not debating that, just telling you I made an IT10T error...  ;D

ID10T. Heh.  8)
Link to comment

Hey Squid,

 

Just been trying this with a kernel compiling script. 

 

#!/bin/bash
wget https://raw.githubusercontent.com/CHBMB/Unraid-DVB/master/build_scripts/kernel_compile_modules/kernel_compile_module_use_config_beta.sh -P /mnt/disk1/dvb/
chmod +x /mnt/disk1/dvb/kernel_compile_module_use_config_beta.sh
cd /mnt/disk1/dvb/
/mnt/disk1/dvb/kernel_compile_module_use_config_beta.sh

 

Now i'm running it in the foreground so I can follow it's progress, but it's running very slowly, well specifically, the logging seems to be running slowly, the actual script is running faster I think if that makes sense.

 

Can't quite get my head around what is happening apart from maybe my CPU is flat out and the logging is lagging behind...

Link to comment

If there's tons and tons and tons of stuff to display then it's going to lag because of the constant page update for each line and chrome chugging through it.  No different than hitting the log button on unraid keeping it open for a month (so there's an insane amount of lines already displayed) and the watching it as you log more items.

 

Nothing I can do about it.

 

The upcoming background running with logging will alleviate that to a certain extent

 

Sent from my LG-D852 using Tapatalk

 

 

Link to comment

If there's tons and tons and tons of stuff to display then it's going to lag because of the constant page update for each line and chrome chugging through it.  No different than hitting the log button on unraid keeping it open for a month (so there's an insane amount of lines already displayed) and the watching it as you log more items.

 

Nothing I can do about it.

 

The upcoming background running with logging will alleviate that to a certain extent

 

Sent from my LG-D852 using Tapatalk

 

 

Great confirms what I thought.  I'll run it as a background and send an alert when it's finished.

Link to comment

ALL GLORY TO THE HYPNOTOAD

 

- Added in automatic background script logging (and ability to delete the logs when the script isn't running)

- Fixed the inability to run a script in the background if the directory contained a space

 

The log display is just a tail of the log  (at the start and end of execution, the plugin will inform you of the location of the complete log should you need to analyze it)

 

ALL GLORY TO THE HYPNOTOAD

Link to comment

keep-calm-and-trust-in-karma.png

 

Added in background scheduling for scripts

 

Schedules are hourly, daily, weekly, monthly.  The time of execution can be modified by the Dynamix Schedules plugin (available on CA)

 

 

Edited by Squid
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.