omv8:omv8_plugins:scripts

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
omv8:omv8_plugins:scripts [2025/12/23 19:18] – [Note] chenteomv8: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.
 +
 +<html><body><table width="100%" border="0"><tr><td colspan="2" style="background-color:#FFB663;height:30px;"><strong><span style="color:#FFFFFF;font-size:110%;">&#160; 
 +Warning
 +</span></strong></td></tr><tr><td style="background-color:#FFE4A6;padding:10px;width:380px;">
 +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.<br>
 +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.<br>
 +Use this plugin with this in mind.
 +</tr></table></body></html>
 +
 +----
 +
 +===== Prerequisites =====
 +
 +  * [[https://wiki.omv-extras.org/doku.php?id=misc_docs:omv_extras|OMV-Extras]] must be pre-installed.
 +
 +----
 +
 +===== Installation =====
 +
 +In OMV8's GUI:\\
 +Under **System**, **Plugins**, find and highlight **openmediavault-scripts 8.X**, and click the **Install** button.
 +
 +  * Installing the openmediavault-scripts plugin will also install the openmediavault-sharerootfs plugin as a dependency.
 +
 +<html><body><table width="100%" border="0"><tr><td colspan="2" style="background-color:#FFB663;height:30px;"><strong><span style="color:#FFFFFF;font-size:110%;">&#160; 
 +Warning
 +</span></strong></td></tr><tr><td style="background-color:#FFE4A6;padding:10px;width:380px;">
 +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.
 +</tr></table></body></html>
 +
 +----
 +
 +===== Settings tab =====
 +
 +<html><center>Under <b>Services</b>, <b>Scripts</b>, <b>Settings</b></center></html>
 \\ \\
 +{{ :omv8:omv8_plugins:scripts01.png?direct&1000 |Services Scripts Settings}}
 +
 +* 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**: Choose between Rotate daily, Rotate weekly (default), or Rotate monthly.
 +  * **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**: Unit for script logs retention. Default is Rotate daily.
 +  * **Number of units before delete \***: Number of days/weeks/months to keep logs. Default is 14.
 +  * **Remove empty log files**: Checkbox to remove empty log files. Default is unchecked.
 +
 +----
 +
 +===== Scripts tab =====
 +
 +<html><center>Under <b>Services</b>, <b>Scripts</b>, <b>Scripts</b></center></html>
 \\ \\
 +{{ :omv8:omv8_plugins:scripts02.png?direct&1000 |Services Scripts Scripts}}
  
-=== 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 for OMV8 is still being written.+{{ :omv8:omv8_plugins:scripts03.png?direct&600|Add}} 
 +  * **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**: sh, json, php, etc. 
 +      * **Script**: Script code; you can paste from clipboard. 
 +      * **Testing arguments**: Optional arguments for execution from the Scripts tab only. 
 +    * **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 nowyou can use the documentation written for OMV7 as reference.+=== Edit === 
 + 
 +  * Select a script and press **Edit**. Modify the script and/or argumentsthen 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/style checks depending on script type. 
 + 
 +=== Run === 
 + 
 +{{ :omv8:omv8_plugins:scripts04.png?direct&600|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. 
 + 
 +<html><body><table width="100%" border="0"><tr><td colspan="2" style="background-color:#69A5FF;height:30px;"><strong><span style="color:#FFFFFF;font-size:110%;">&#160; Note 
 +</span></strong></td></tr><tr><td style="background-color:#E6FEFF;padding:10px;width:380px;"> 
 +In this dialog box the output of the script will be displayed.<br> 
 +Dialogs generated with Bash Dialog or similar cannot be interacted with or displayed. 
 +</tr></table></body></html> 
 + 
 +=== Git === 
 + 
 +  * Manage scripts versioned in a Git repository. 
 + 
 +=== Docs === 
 + 
 +  * Press the **Docs** button to access this wiki document. 
 + 
 +---- 
 + 
 +===== Schedule tab ===== 
 + 
 +<html><center>Under <b>Services</b>, <b>Scripts</b>, <b>Schedule</b></center></html> 
 +\\ 
 +{{ :omv8:omv8_plugins:scripts05.png?direct&1000 |Services Scripts Schedule}} 
 + 
 +  * Displays a list of created scheduled jobs. You can create, edit, delete, or run them manually. 
 + 
 +=== Create === 
 + 
 +{{ :omv8:omv8_plugins:scripts06.png?direct&600|Schedule}} 
 +  * Press **Create** to define a script schedule: 
 +    * **Enabled**: Activate scheduled execution. 
 +    * **Script**: Choose an existing script. 
 +    * **Script arguments**: Optional. 
 +    * **Schedule**: Define when to run. 
 +    * **Send command output via email**: Optional; requires System > Notification configuration. 
 +    * **Comment**: Header for email notifications. 
 + 
 +=== Edit === 
 + 
 +  * Select schedule and press **Edit** to modify all fields. 
 + 
 +=== Delete === 
 + 
 +  * Select a schedule and press **Delete** to remove it. Other schedules or scripts are not affected. 
 + 
 +=== 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://github.com/OpenMediaVault-Plugin-Developers/openmediavault-scripts|openmediavault-scripts]] 
 + 
 +---- 
 + 
 +===== 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** 
 +\\ 
 +<html> 
 +<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top"> 
 +<input type="hidden" name="cmd" value="_s-xclick"> 
 +<input type="hidden" name="hosted_button_id" value="2BQNGSC8HQJME"> 
 +<input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_donate_SM.gif" name="submit" title="PayPal - The safer, easier way to pay online!" alt="Donate with PayPal button" border="0"> 
 +<img alt="" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1" border="0"> 
 +</form> 
 +</html> 
 +\\ 
 +\\ 
 +**Venmo: ryecoaaron** \\
  
-Go to -> [[omv7:omv7_plugins:scripts|Scripts Plugin For OMV7]] 
  • omv8/omv8_plugins/scripts.1766517523.txt.gz
  • Last modified: 2025/12/23 19:18
  • by chente