Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| omv8:omv8_plugins:scripts [2025/12/22 05:22] – created chente | omv8:omv8_plugins:scripts [2025/12/25 08:50] (current) – [Run] chente | ||
|---|---|---|---|
| Line 5: | Line 5: | ||
| ====== Scripts Plugin For OMV8 ====== | ====== Scripts Plugin For OMV8 ====== | ||
| + | |||
| + | ===== Summary ===== | ||
| + | |||
| + | * openmediavault-scripts provides a tool to create scripts from the OMV GUI, execute those scripts, and/or schedule their execution. | ||
| + | * Each script will be stored in the OMV database, plus a copy of each script will be created in the shared folder configured in the plugin. | ||
| + | |||
| + | < | ||
| + | Warning | ||
| + | </ | ||
| + | A script has the potential to perform absolutely any action on your system, from damaging essential files to introducing a virus or hacking the server.< | ||
| + | Be very careful about copying and running a third-party script. If you don't know exactly what that script is doing, you may lose control of your server.< | ||
| + | Use this plugin with this in mind. | ||
| + | </ | ||
| + | |||
| + | ---- | ||
| + | |||
| + | ===== Prerequisites ===== | ||
| + | |||
| + | * [[https:// | ||
| + | |||
| + | ---- | ||
| + | |||
| + | ===== Installation ===== | ||
| + | |||
| + | In OMV8's GUI:\\ | ||
| + | Under **System**, **Plugins**, | ||
| + | |||
| + | * Installing the openmediavault-scripts plugin will also install the openmediavault-sharerootfs plugin as a dependency. | ||
| + | |||
| + | < | ||
| + | Warning | ||
| + | </ | ||
| + | Do not uninstall the openmediavault-sharerootfs plugin. It is a dependency of the openmediavault-scripts plugin. Uninstalling it while the Scripts plugin is installed will cause the Scripts plugin to be uninstalled. | ||
| + | </ | ||
| + | |||
| + | ---- | ||
| + | |||
| + | ===== Settings tab ===== | ||
| + | |||
| + | < | ||
| \\ | \\ | ||
| + | {{ : | ||
| + | |||
| + | * Go to **Services** > **Scripts** > **Settings** and configure the initial parameters of the plugin. | ||
| + | |||
| + | === Shared folder === | ||
| + | |||
| + | * Choose a **Shared folder** (or create a new one by clicking the Create button on the right). | ||
| + | * A copy of each script created with the plugin will be stored in this folder. | ||
| + | * This file is just a backup copy of the script. Modifications made to this file manually will not be reflected in the OMV GUI and will be overwritten if you modify the script from the plugin GUI. Use the GUI to edit your script. | ||
| + | * Define the **Owner of scripts**, the owner **Group of scripts**, and the **Permissions of scripts** that the files stored in this folder will have using the corresponding fields. | ||
| + | |||
| + | === Logs Management === | ||
| + | |||
| + | * **Period of service log retention**: | ||
| + | * **Number of separate compressed logs to keep \***: Number of files to retain, a new file is created each period. Default is 12. | ||
| + | * **Unit of script log retention**: | ||
| + | * **Number of units before delete \***: Number of days/ | ||
| + | * **Remove empty log files**: Checkbox to remove empty log files. Default is unchecked. | ||
| + | |||
| + | ---- | ||
| + | |||
| + | ===== Scripts tab ===== | ||
| + | |||
| + | < | ||
| \\ | \\ | ||
| + | {{ : | ||
| - | === Note === | + | * In this form a list of the created scripts appears. Here you can create, edit, delete, or run scripts manually. |
| - | This plugin is now available for OMV8. | + | === Add === |
| - | The documentation | + | {{ : |
| + | * **Add** button Opens a menu with the following options: | ||
| + | * **Add** – Create a new generic script. Define: | ||
| + | * **Name**: Name used to save and execute the script. | ||
| + | * **Extension**: | ||
| + | * **Script**: Script code; you can paste from clipboard. | ||
| + | * **Testing arguments**: | ||
| + | * **Add Python** – Create a new Python script. | ||
| + | * **Add from URL** – Create a script by fetching it from a URL. | ||
| + | * **Import** – Import multiple scripts from the server filesystem. | ||
| + | * **Import one** – Import a single script from the server filesystem. | ||
| + | * **Sync changes from file** – Update the script in the database with modifications made in the file copy. | ||
| + | * The script is stored in the OMV database. | ||
| + | * A copy is saved in the shared folder defined in the Settings tab. | ||
| + | * A line with the script data appears in the Scripts form. | ||
| - | For now, you can use the documentation written for OMV7. The changes for the OMV8 version | + | === Edit === |
| + | |||
| + | * Select a script and press **Edit**. Modify the script and/or arguments, then press **Save** or **Cancel**. | ||
| + | |||
| + | === Delete === | ||
| + | |||
| + | * Select a script and press **Delete**. This removes it from the database and shared folder. | ||
| + | |||
| + | === Check using Shellcheck or Pylint === | ||
| + | |||
| + | * Run syntax/ | ||
| + | |||
| + | === Run === | ||
| + | |||
| + | {{ : | ||
| + | * Select a script and press **Run** to manually execute it. | ||
| + | * A code box shows execution output. | ||
| + | * Press **Start** to run, **Stop** to stop execution, **Close** to exit. | ||
| + | |||
| + | < | ||
| + | </ | ||
| + | In this dialog box the output of the script will be displayed.< | ||
| + | Dialogs generated with Bash Dialog or similar cannot be interacted with or displayed. | ||
| + | </ | ||
| + | |||
| + | === Git === | ||
| + | |||
| + | * Manage scripts versioned in a Git repository. | ||
| + | |||
| + | === Docs === | ||
| + | |||
| + | * Press the **Docs** button to access this wiki document. | ||
| + | |||
| + | ---- | ||
| + | |||
| + | ===== Schedule tab ===== | ||
| + | |||
| + | < | ||
| + | \\ | ||
| + | {{ : | ||
| + | |||
| + | * Displays a list of created scheduled jobs. You can create, edit, delete, or run them manually. | ||
| + | |||
| + | === Create === | ||
| + | |||
| + | {{ : | ||
| + | * Press **Create** to define a script schedule: | ||
| + | * **Enabled**: | ||
| + | * **Script**: Choose an existing script. | ||
| + | * **Script arguments**: | ||
| + | * **Schedule**: | ||
| + | * **Send command output via email**: Optional; requires System > Notification configuration. | ||
| + | * **Comment**: | ||
| + | |||
| + | === Edit === | ||
| + | |||
| + | * Select a schedule and press **Edit** to modify all fields. | ||
| + | |||
| + | === Delete === | ||
| + | |||
| + | * Select a schedule and press **Delete** to remove it. Other schedules or scripts | ||
| + | |||
| + | === Run === | ||
| + | |||
| + | * Select a schedule and press **Run** to manually execute it. | ||
| + | * A dialog box will show execution output. | ||
| + | * Press **Start** to run, **Stop** to stop, **Close** to exit. | ||
| + | |||
| + | ---- | ||
| + | |||
| + | ===== Source Code ===== | ||
| + | |||
| + | -> [[https:// | ||
| + | |||
| + | ---- | ||
| + | |||
| + | ===== A Closing Note ===== | ||
| + | |||
| + | We, who support the openmediavault project, hope you've found this guide to be useful and that you'll find your openmediavault server to be efficient, easy to use, and enjoyable.\\ | ||
| + | \\ | ||
| + | If you found this plugin guide to be helpful, please consider a modest donation to support the hosting costs of this server.\\ | ||
| + | \\ | ||
| + | **OMV-Extras.org** | ||
| + | \\ | ||
| + | < | ||
| + | <form action=" | ||
| + | <input type=" | ||
| + | <input type=" | ||
| + | <input type=" | ||
| + | <img alt="" | ||
| + | </ | ||
| + | </ | ||
| + | \\ | ||
| + | \\ | ||
| + | **Venmo: ryecoaaron** \\ | ||
| - | Go to -> [[omv7: | ||