[Plugin] CA User Scripts


Recommended Posts

11 hours ago, Squid said:

yes

 

Ok, did reboot to collect required information.

 

1.) Before reboot. You can see that /etc/cron.d/root and /boot/config/plugins/user.scripts/customSchedule.cron do exist and contain all custom schedules from the User Scripts plugin:

 

root@Tower:~# ls -l /etc/cron.d/root
-rw------- 1 root root 1157 Sep  4 14:50 /etc/cron.d/root

root@Tower:~# cat /etc/cron.d/root
[... Standard Unraid cron jobs ignored ...]
# Generated cron schedule for user.scripts
35 4 * * 0 /usr/local/emhttp/plugins/user.scripts/startCustom.php /boot/config/plugins/user.scripts/scripts/Backup/script > /dev/null 2>&1
30 4 * * 0 /usr/local/emhttp/plugins/user.scripts/startCustom.php /boot/config/plugins/user.scripts/scripts/Backup Flash/script > /dev/null 2>&1
40 4 * * * /usr/local/emhttp/plugins/user.scripts/startCustom.php /boot/config/plugins/user.scripts/scripts/Backup Tree/script > /dev/null 2>&1

root@Tower:~# ls -l /boot/config/plugins/user.scripts/customSchedule.cron
-rw------- 1 root root 472 Sep  4 14:50 /boot/config/plugins/user.scripts/customSchedule.cron

root@Tower:~# cat /boot/config/plugins/user.scripts/customSchedule.cron
# Generated cron schedule for user.scripts
35 4 * * 0 /usr/local/emhttp/plugins/user.scripts/startCustom.php /boot/config/plugins/user.scripts/scripts/Backup/script > /dev/null 2>&1
30 4 * * 0 /usr/local/emhttp/plugins/user.scripts/startCustom.php /boot/config/plugins/user.scripts/scripts/Backup Flash/script > /dev/null 2>&1
40 4 * * * /usr/local/emhttp/plugins/user.scripts/startCustom.php /boot/config/plugins/user.scripts/scripts/Backup Tree/script > /dev/null 2>&1

 

2.) After reboot. You can see that /etc/cron.d/root does exist but does not contain the custom schedules. /boot/config/plugins/user.scripts/customSchedule.cron does exist and does contain all custom schedules from the User Scripts plugin:

 

root@Tower:~# ls -l /etc/cron.d/root
-rw------- 1 root root 533 Sep  5 11:44 /etc/cron.d/root

root@Tower:~# cat /etc/cron.d/root
[... Standard Unraid cron jobs ignored ...]

root@Tower:~# ls -l /boot/config/plugins/user.scripts/customSchedule.cron
-rw------- 1 root root 472 Sep  4 14:50 /boot/config/plugins/user.scripts/customSchedule.cron

root@Tower:~# cat /boot/config/plugins/user.scripts/customSchedule.cron
# Generated cron schedule for user.scripts
35 4 * * 0 /usr/local/emhttp/plugins/user.scripts/startCustom.php /boot/config/plugins/user.scripts/scripts/Backup/script > /dev/null 2>&1
30 4 * * 0 /usr/local/emhttp/plugins/user.scripts/startCustom.php /boot/config/plugins/user.scripts/scripts/Backup Flash/script > /dev/null 2>&1
40 4 * * * /usr/local/emhttp/plugins/user.scripts/startCustom.php /boot/config/plugins/user.scripts/scripts/Backup Tree/script > /dev/null 2>&1

 

3. Update the custom schedules via User Scripts command line tool. You can see that after running that tool the custom schedules reappear in /etc/cron.d/root:

 

root@Tower:~# update_cron

root@Tower:~# ls -l /etc/cron.d/root
-rw------- 1 root root 1158 Sep  5 11:49 /etc/cron.d/root

root@Tower:~# cat /etc/cron.d/root
[... Standard Unraid cron jobs ignored ...]
# Generated cron schedule for user.scripts
35 4 * * 0 /usr/local/emhttp/plugins/user.scripts/startCustom.php /boot/config/plugins/user.scripts/scripts/Backup/script > /dev/null 2>&1
30 4 * * 0 /usr/local/emhttp/plugins/user.scripts/startCustom.php /boot/config/plugins/user.scripts/scripts/Backup Flash/script > /dev/null 2>&1
40 4 * * * /usr/local/emhttp/plugins/user.scripts/startCustom.php /boot/config/plugins/user.scripts/scripts/Backup Tree/script > /dev/null 2>&1

 

Edited by hawihoney
Link to comment
6 hours ago, Squid said:

Can you reply back with your diagnostics.

 

This is TowerVM01 that's running a Disk-Rebuild currently and was rebootet upfront.

 

I can confirm that the "custom schedules" worked during all reboots on all servers here on all releases before 6.12.4 (coming from 6.11.5). It's the virtualized servers that don't run upgrade_cron any longer. I will address that in a Bug Report.

 

The only things I changed on all servers before upgrading to 6.12.4 were:

 

- Enable bonding=yes

- Enable bridging=no

- Host access to custom networks=yes

- Enable autostart=no (to make the three changes above before starting the array)

 

Thanks for your time.

 

towervm01-diagnostics-20230906-0722.zip

Edited by hawihoney
Link to comment
9 hours ago, OtherSide said:

I am getting the same issue as BigRed8150. It was working earlier today.

I just tried it, nothing happens when clicking the "edit script" button. No windows pop up.

Have the same issue. Running 6.12.4. Can edit the name and description but not the script itself. Tried 3 different browser.

Edited by Llamrei
Link to comment

@Squid - For me at least, I get the following error on page load... (Chrome)

 

ace.js:1 Uncaught TypeError: Cannot set properties of undefined (setting 'packaged')
    at o (ace.js:1:144)
    at ace.js:1:1594
    at ace.js:1:1612
o @ ace.js:1
(anonymous) @ ace.js:1
(anonymous) @ ace.js:1
dynamix.js?v=1680052794:5 jQuery.Deferred exception: ace.edit is not a function TypeError: ace.edit is not a function
    at HTMLDocument.<anonymous> (https://192-168-1-10.878757bd53f71ad14272183dbae65d47ceb4439a.myunraid.net/Settings/Userscripts:1218:20)
    at e (https://192-168-1-10.878757bd53f71ad14272183dbae65d47ceb4439a.myunraid.net/webGui/javascript/dynamix.js?v=1680052794:5:30310)
    at t (https://192-168-1-10.878757bd53f71ad14272183dbae65d47ceb4439a.myunraid.net/webGui/javascript/dynamix.js?v=1680052794:5:30612) undefined
E.Deferred.exceptionHook @ dynamix.js?v=1680052794:5
t @ dynamix.js?v=1680052794:5
setTimeout (async)
(anonymous) @ dynamix.js?v=1680052794:5
c @ dynamix.js?v=1680052794:5
fireWith @ dynamix.js?v=1680052794:5
fire @ dynamix.js?v=1680052794:5
c @ dynamix.js?v=1680052794:5
fireWith @ dynamix.js?v=1680052794:5
ready @ dynamix.js?v=1680052794:5
$ @ dynamix.js?v=1680052794:5
dynamix.js?v=1680052794:5 Uncaught TypeError: ace.edit is not a function
    at HTMLDocument.<anonymous> (Userscripts:1218:20)
    at e (dynamix.js?v=1680052794:5:30310)
    at t (dynamix.js?v=1680052794:5:30612)

 

...and then when clicking on edit script...

 

Userscripts:1491 Uncaught TypeError: ace.edit is not a function
    at Object.success (Userscripts:1491:24)
    at c (dynamix.js?v=1680052794:5:28599)
    at Object.fireWith [as resolveWith] (dynamix.js?v=1680052794:5:29344)
    at l (dynamix.js?v=1680052794:5:80328)
    at XMLHttpRequest.<anonymous> (dynamix.js?v=1680052794:5:82782)

 

Hope this helps.

Link to comment

Tried the following:

 

Chrome (Windows & Mac)

Firefox (Mac)

Safari (Mac)

Brave (Windows)

Edge (Windows)

Internet Explorer (Windows)

 

Everything worked on editing a script except for Internet Explorer, but since Unraid doesn't support it to begin with (and the GUI won't even load on it) I'm not worried about IE

 

Is it an ad blocker or something?  

Link to comment
8 minutes ago, Squid said:

Tried the following:

 

Chrome (Windows & Mac)

Firefox (Mac)

Safari (Mac)

Brave (Windows)

Edge (Windows)

Internet Explorer (Windows)

 

Everything worked on editing a script except for Internet Explorer, but since Unraid doesn't support it to begin with (and the GUI won't even load on it) I'm not worried about IE

 

Is it an ad blocker or something?  

I'm on a mac running macos 13.5.1 and using Chrome Version 116.0.5845.140 , I just disabled all extensions and went to an Incognito window and can still replicate the issue.

 

Anything I can grab or try that might help narrow it down?

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.