You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Admin script configuration UI: add possibility to enable/disable scheduling #362
Thought I'd leave my workaround here as well, since I've seen it mentioned in some threads, but no actual examples.
Simple script that checks the folder where the schedules are stored, giving you the option to "manage them", as in delete or list contents. Not pretty but does the job:
Runner:
{ "name": "\ud83d\udcbbAdmin Schedule Management", "script_path": "/Script-Server/conf/scripts/Scheduled/admin_schedule_management.sh", "working_directory": "/", "description": "Script used for administering schedules", "group": "Administration", "requires_terminal": true, "allowed_users": [ "@blabla"], "parameters": [ { "name": "Action", "required": true, "type": "list", "description": "Which action would you like to perform?", "default": "list", "values": [ "list", "delete" ] }, { "name": "File", "required": true, "type": "server_file", "description": "Which file do you want to work on?", "file_dir": "/Script-Server/conf/schedules", "file_type": "file" } ] }
Script:
`#!/bin/sh
ACTION=${1}
FILE_RAW=${2}
FILE=$(echo $FILE_RAW | sed 's/ /\ /g') #Strips spaces from filenames, posix doesn't like that.
case ${ACTION} in list)
COMMAND="cat"
;; delete)
COMMAND="rm"
;;
*)
printf "$red" "Invalid option, please chose list/delete"
esac
printf "Okay, running ${COMMAND} on the selected file: ${FILE}"
printf "\n\n"
${COMMAND} ${FILE}`
Activity
mitchtchesnitch commentedon Nov 3, 2020
Thought I'd leave my workaround here as well, since I've seen it mentioned in some threads, but no actual examples.
Simple script that checks the folder where the schedules are stored, giving you the option to "manage them", as in delete or list contents. Not pretty but does the job:
Runner:
{ "name": "\ud83d\udcbbAdmin Schedule Management", "script_path": "/Script-Server/conf/scripts/Scheduled/admin_schedule_management.sh", "working_directory": "/", "description": "Script used for administering schedules", "group": "Administration", "requires_terminal": true, "allowed_users": [ "@blabla"], "parameters": [ { "name": "Action", "required": true, "type": "list", "description": "Which action would you like to perform?", "default": "list", "values": [ "list", "delete" ] }, { "name": "File", "required": true, "type": "server_file", "description": "Which file do you want to work on?", "file_dir": "/Script-Server/conf/schedules", "file_type": "file" } ] }Script:
`#!/bin/sh
ACTION=${1}
FILE_RAW=${2}
FILE=$(echo $FILE_RAW | sed 's/ /\ /g') #Strips spaces from filenames, posix doesn't like that.
case ${ACTION} in
list)
COMMAND="cat"
;;
delete)
COMMAND="rm"
;;
*)
printf "$red" "Invalid option, please chose list/delete"
esac
printf "Okay, running ${COMMAND} on the selected file: ${FILE}"
printf "\n\n"
${COMMAND} ${FILE}`
bugy commentedon Nov 3, 2020
Hehe, nice! :)
One side note question out of curiosity: why are you using
"file_recursive": "True"? It's not necessary, when you don't have nested foldersmitchtchesnitch commentedon Nov 3, 2020
You're right, now that I think of it, that doesn't make sense, I removed that:D
Gamma-Software commentedon Aug 3, 2021
I replaced
${COMMAND} ${FILE}by${COMMAND} "${FILE}"Reason: I was not able to remove schedules configs with space in names
#362 added possibility to enable scheduling via admin UI
bugy commentedon Feb 17, 2023
just a note: this issue is about adding a possibility on admin UI to enable scheduling for a particular script configuration:

And this is resolved now
There is a separate ticket in #625 for managing created schedules