HeavyScript Setup
Overview
HeavyScript installation and setup for TrueNAS management.
Assumptions
TrueNAS Scale Setup completed.
Logged in as administrative user.
Install HeavyScript
HeavyScript is a bash tool for automating TrueNAS Scale application management. It is recommended in the TrueCharts documentation, but is not required when using TrueCharts. Refer to the HeavyScript GitHub repository for more information.
Deploy
HeavyScript is not a TrueNAS or TrueCharts application, it must be installed from terminal. Open a shell session on your server: System Settings
- Shell
.
Review the HeavyScript deploy script on GitHub. The HeavyScript one line installation can be completed using curl.
curl -s https://raw.githubusercontent.com/Heavybullets8/heavy_script/main/functions/deploy.sh | bash && source "$HOME/.bashrc" 2>/dev/null && source "$HOME/.zshrc" 2>/dev/null
Schedule
Schedule HeavyScript to run with a cron job.
Command
HeavyScript command to update system applications. Can be configured with multiple flags, refer to the project repository for a full flag list.
Basic update command, use this when configuring with a config.ini
file.
bash /root/heavy_script/heavy_script.sh update
Update command with flags, set to ignore config.ini
file.
bash /root/heavy_script/heavy_script.sh update --backup 14 --concurrent 5 --no-config --prune --rollback --sync --self-update
Flag | Description |
---|---|
--backup 14 | Create backup and keep specified number of backups. |
--concurrent 5 | How many applications to update at once. |
--prune | Remove unused images after updates. |
--no-config | Ignore the config.ini file. This will use defaults unless a value is specified with a flag. Remove this to use config.ini for configuration. |
--rollback | Rollback to previous version if update fails. |
--sync | Sync catalogs. |
--self-update | Update HeavyScript. |
Cron Job
Schedule a cron job on the TrueNAS system in advanced settings. Navigate to System Settings
- Advanced
and locate the Cron Jobs
section.
Select Add
to add a new cron job, read the warning provided by TrueNAS. Configure it as detailed, modify the command as necessary for the system.
Setting | Value | Description |
---|---|---|
Description | HeavyScript | Cron job description when viewing in the administrative interface. |
Command | HEAVYSCRIPT_COMMAND | HeavyScript command to execute when scheduled. Modify to flags as required. |
Run As User | root | User to execute the cron job as. HeavyScript requires being the root user to function. |
Schedule | (0 5 * * *) | When to run the cron job. This value will run the the job at 5:00 AM every day. |
Hide Standard Output | false | When false, standard output will be sent to the executing user. |
Hide Standard Error | false | When false, error output will be sent to the executing user. |
Enabled | true | Run state of the cron job. |
Save the cron job and optionally Run Now
to verify it works as intended.
Configure HeavyScript
The configuration file is created when the script is first executed. Run the script once before attempting to modify its settings.
When using the config.ini
for configuring HeavyScript, remove the --no-config
flag from the cron job command.
nano /root/heavy_script/config.ini