[Plugin] CA User Scripts


Recommended Posts

@Squid

 

Would be nice to have some code or maybe a built in function of the Plugin to backup/restore all scripts. I've massed several of them and well it would really be disappointing if I messed up and lost them all. Maybe part of the Backup/Restore Plugin we all love. 😀Yes I know they are originally saved on the Flash Drive, but you always do things so much more Elegant. 

 

Just in case your board and have nothing else to work on. Lol

Link to comment
On 2/23/2019 at 8:16 PM, Cessquill said:

There may be a valid reason why this is not done already, but if you edit the name of the script, could it also update the name of the corresponding folder in the user.scripts\scripts directory?

I could make up something long, convoluted, and technical as a reason why it doesn't do that but it would all be bs.  The simple answer is that when I did this, I never thought of that, and why it still doesn't do it is pure laziness

  • Like 3
  • Upvote 1
Link to comment
12 hours ago, Squid said:

I could make up something long, convoluted, and technical as a reason why it doesn't do that but it would all be bs.  The simple answer is that when I did this, I never thought of that, and why it still doesn't do it is pure laziness

That's the spirit!

 

Some of my projects at work have more comment than code.

Link to comment

I have a Daily DVR Section on my plex server.  It records the OTA Daily TV shows but they way plex is setup it keeps shows until its watched and then deleted.  

I don't know how to script but looking for someone to create a script.  I want this to run at midnight and I wanted to delete all video files older than 24hours or have it flagged as watched and plex will delete automatically. 

Link to comment

I'm having a strange issue. All my schedules somehow got set to disabled and when i try to re-enable the schedule, i can't press "Apply". Nothing happens. If i go back to the page, it's all disabled again. I've tried different browsers and have rebooted several times (for other reasons) and it's still not working. The scripts work fine if run manually. I've tried removing and re-adding the user scripts plugin, didn't help.

Link to comment
I'm having a strange issue. All my schedules somehow got set to disabled and when i try to re-enable the schedule, i can't press "Apply". Nothing happens. If i go back to the page, it's all disabled again. I've tried different browsers and have rebooted several times (for other reasons) and it's still not working. The scripts work fine if run manually. I've tried removing and re-adding the user scripts plugin, didn't help.
Post your diagnostics

Sent via telekinesis

  • Upvote 1
Link to comment
2 hours ago, UntouchedWagons said:

My script file is a python script, but it keeps failing because python decides to use ANSII instead of UTF-8. It turns out that the LANG environment variable is not being set to en_US.UTF-8. Any ideas how I could fix that without having a boiler plate shell script?

https://forums.unraid.net/topic/48286-plugin-ca-user-scripts/?page=25&tab=comments#comment-720270

 

  • Upvote 1
Link to comment
1 hour ago, Squid said:

What is the output of


ls -ail /boot/config/plugins/user.scripts/scripts/

 

4041 drwxrwxrwx 14 root root 8192 Mar 12 16:24 ./
4039 drwxrwxrwx  3 root root 8192 Jan 16 05:43 ../
5133 drwxrwxrwx  2 root root 8192 Nov 18 18:57 USB\ HotPlug/
5105 drwxrwxrwx  2 root root 8192 Nov 18 18:57 apcupsd?.sh/
5109 drwxrwxrwx  2 root root 8192 Nov 18 18:57 clear\ an\ array\ drive/
5115 drwxrwxrwx  2 root root 8192 Nov 18 18:57 delete.ds_store/
5112 drwxrwxrwx  2 root root 8192 Nov 18 18:57 delete_dangling_images/
5118 drwxrwxrwx  2 root root 8192 Mar  1 23:23 duplicacy\ install/
5124 drwxrwxrwx  2 root root 8192 Nov 18 18:57 icon\ sync/
5121 drwxrwxrwx  2 root root 8192 Nov 18 18:57 icon_banner\ downloader/
5127 drwxrwxrwx  2 root root 8192 Nov 18 18:57 move\ array\ only\ shares/
5130 drwxrwxrwx  2 root root 8192 Nov 18 18:57 move\ cache\ only\ shares/
5135 drwxrwxrwx  2 root root 8192 Nov 18 18:57 viewDockerLogSize/
5138 drwxrwxrwx  2 root root 8192 Nov 18 18:57 vm\ settings\ backup/

 

Link to comment

Feeling like a huge idiot! I have 2 unraid servers. One on 6.6.6 one on 6.3.5. I found and installed User Scripts in the 6.6.6 but when I search CA for "User Scripts" in the 6.3.5 machine I get "No Matching Content Found" but if I search just "User" I get 21 results none of which are the right one. What gives?

 

I did manage to install it manually using the URL, someone tell me this is either very weird or very common.

Edited by Adriano90
Solved...kinda
Link to comment
21 minutes ago, Adriano90 said:

6.3.5.

Since your server is 6.3.5, you are running a very old version of CA which is using an outdated and unreliable application feed that doesn't even have 1/10th of the apps available.  CA has required 6.4+ for quite a while now and the URLs for the feed changed a long time ago.  Update your server and CA

Link to comment
26 minutes ago, Squid said:

Since your server is 6.3.5, you are running a very old version of CA which is using an outdated and unreliable application feed that doesn't even have 1/10th of the apps available.  CA has required 6.4+ for quite a while now and the URLs for the feed changed a long time ago.  Update your server and CA

Was planning on updating after a backup which I was trying to use the script to do (JUST IN CASE). Thanks for the help!

Link to comment

OK, so back again. I am trying to use the 'clear array drive' script in order to shrink my array. I added a drive to the array earlier today and shortly realized that another drive was acting up. I am in the process of trying to remove the newly added drive by the clear drive and then redeploy it for the dodgy drive to be rebuilt.

 

When I run the script, it finishes instantly and the folder 'clear-me' still remains on the drive in question. This drive was only added to the array and formatted (to do so) so does not have any data on it. I don't see any pesky hidden files, so I am wondering how to get it to zero the drive?

Link to comment
19 minutes ago, johnnie.black said:

I believe the script isn't working very well with current Unraid, if you want to do that and are semi-comfortable with the console you can do it manually:

 

https://forums.lime-technology.com/topic/61614-shrink-array-question/?tab=comments#comment-606335

Thanks again Johnnie.

 

Just to be extra clear (paranoid) the UnRAID managed device number should always be the same as the disk number, correct? So if I need to zero disk 16, I would use md16. Sorry for the cluelessness.

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.