{"id":13602829,"url":"https://github.com/Heavybullets8/heavy_script","last_synced_at":"2025-04-11T13:31:28.326Z","repository":{"id":38018434,"uuid":"484207937","full_name":"Heavybullets8/heavy_script","owner":"Heavybullets8","description":"Bash script for managing Truenas SCALE applications, automatically update applications, backup applications datasets, open a shell for containers.","archived":true,"fork":false,"pushed_at":"2024-06-06T22:09:57.000Z","size":747,"stargazers_count":385,"open_issues_count":0,"forks_count":27,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-11-05T08:42:47.648Z","etag":null,"topics":["bash","bash-script","script","scripts","shell-script","truenas-scale","truenas-scripts"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Heavybullets8.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-04-21T21:18:26.000Z","updated_at":"2024-11-04T05:51:46.000Z","dependencies_parsed_at":"2024-05-22T22:26:56.552Z","dependency_job_id":"8d4b2091-ff1d-4b38-93b3-c902c5a67d09","html_url":"https://github.com/Heavybullets8/heavy_script","commit_stats":null,"previous_names":[],"tags_count":70,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Heavybullets8%2Fheavy_script","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Heavybullets8%2Fheavy_script/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Heavybullets8%2Fheavy_script/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Heavybullets8%2Fheavy_script/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Heavybullets8","download_url":"https://codeload.github.com/Heavybullets8/heavy_script/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223470269,"owners_count":17150524,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bash","bash-script","script","scripts","shell-script","truenas-scale","truenas-scripts"],"created_at":"2024-08-01T18:01:39.262Z","updated_at":"2024-11-07T06:30:26.462Z","avatar_url":"https://github.com/Heavybullets8.png","language":"Shell","readme":"# HeavyScript\n\n# Archived Repository Notice\n\n## HeavyScript is Archived\n\nDue to the upcoming update for TrueNAS SCALE ([link to update](https://forums.truenas.com/t/the-future-of-electric-eel-and-apps/5409)), where they will be completely removing k3s and replacing it with Docker Compose, I have decided to archive this repository. Since I do not want to use Docker Compose, I will not be supporting it. The tools that HeavyScript offers will all be deprecated by this release due to that change, as the tools are designed for TrueNAS SCALE's k3s implementation, not Docker.\n\nInstead, I will be switching over to TalosOS, and users should watch the TrueCharts Discord channel for migration notices.\n\nIt is also worth noting that TrueCharts has archived and completely removed their charts from TrueNAS SCALE as well, as seen here: [TrueCharts Catalog](https://github.com/truecharts/catalog).\n\nTrueCharts' comments on the situation can be seen here: [TrueCharts Deprecation News](https://truecharts.org/news/scale-deprecation/).\n\n## Personal Note\n\nDeveloping HeavyScript was my first project and the most fun I've had with coding. Amassing 380+ stars throughout the years is nothing I ever dreamed of when I started the project, and I am sad to see it go.\n\nThank you to everyone who has supported and used HeavyScript!\n\nBest regards,  \nHeavybullets8\n\n\n## Contact\n\nIf you have questions or would like to contribute, I have a sub discord category hosted on the Truecharts Discord.\n\n[https://discord.gg/tVsPTHWTtr](https://discord.gg/tVsPTHWTtr)\n\n## Table of contents:\n\u003cdetails\u003e\n  \u003csummary\u003eClick to expand\u003c/summary\u003e\n\n* [The Menu](#the-menu)\n* [Arguments](#arguments)\n   * [App](#app)\n   * [Backup](#backup)\n   * [DNS](#dns)\n   * [Git](#git)\n   * [Pod](#pod)\n   * [PVC](#pvc)\n   * [Self-Update](#self-update)\n   * [Sync](#sync)\n   * [Update](#update)\n* [How to Install](#how-to-install)\n* [How to Update](#how-to-update)\n* [Configuration File](#configuration-file)\n* [Cron Jobs](#cron-jobs)\n\u003c/details\u003e\n\n\n\u003cbr\u003e\n\n___\n\n## The Menu\n\n![image](https://github.com/Heavybullets8/heavy_script/assets/20793231/8587a732-ae4d-4ab1-b776-641c1ded0193)\n\n\u003e Access this with `heavyscript`\n\n\u003cbr\u003e\n\n___\n\n## Arguments\n\n### App\n\u003e heavyscript app [Flag]\n\n| Flag           | Example                                  | Parameter                 | Description                               |\n|----------------|------------------------------------------|---------------------------|-------------------------------------------|\n| -s\u003cbr\u003e--start  | -s\u003cbr\u003e--start                            | [Optional: app name]      | Start an application.                     |\n| -x\u003cbr\u003e--stop   | -x\u003cbr\u003e--stop                             | [Optional: app name]      | Stop an application.                      |\n| -r\u003cbr\u003e--restart| -r\u003cbr\u003e--restart                          | [Optional: app name]      | Restart an application.                   |\n| -d\u003cbr\u003e--delete | -d\u003cbr\u003e--delete                           | [Optional: app name]      | Delete an application.                    |\n\n\u003cbr\u003e\n\n### Backup\n\u003e heavyscript backup [Flag]\n\n| Flag                           | Example                                  | Parameter        | Description                             |\n|--------------------------------|------------------------------------------|------------------|-----------------------------------------|\n| -c [number]\u003cbr\u003e--create [number]| -c 15\u003cbr\u003e--create 15                     | Integer          | Create a backup with the specified retention number. |\n| -r\u003cbr\u003e--restore                | -r\u003cbr\u003e--restore                          |                  | Restore a backup.                       |\n| -d\u003cbr\u003e--delete                 | -d\u003cbr\u003e--delete                           |                  | Delete a backup.                        |\n\n\u003cbr\u003e\n\n### DNS\n\u003e heavyscript dns [Optional App Name(s)]\n\nPass an optional app name to display DNS information for that specific app.\n\nIf no app name is provided, it will show internal DNS addresses for all services.\n\nExample:\n```sh\nheavscript dns sonarr radarr nextcloud\n```\n\n\u003cbr \u003e\n\n### Enable\n\u003e heavyscript enable [Flag]\n\n\n| Flag          | Example                               | Description                             |\n|---------------|---------------------------------------|-----------------------------------------|\n| --api         | --api                                 | Enables external access to the Kubernetes API server. |\n| --apt         | --apt                                 | Enable apt, apt-get, and apt-key. |\n| --helm        | --helm                                | Enable helm commands. |\n\n\n\u003cbr \u003e\n\n### Git\n\u003e heavyscript git [Flag]\n\n| Flag                       | Example                                  | Description                                   |\n|----------------------------|------------------------------------------|-----------------------------------------------|\n| -b\u003cbr\u003e--branch             | -b\u003cbr\u003e--branch                           | Choose a branch or tag for HeavyScript to use |\n| -g\u003cbr\u003e--global             | -g\u003cbr\u003e--global                           | Add the script to the global path.            |\n\n\u003cbr\u003e\n\n### Pod\n\u003e heavyscript pod [Flag]\n\n| Flag                       | Example                                  | Description                                  |\n|----------------------------|------------------------------------------|----------------------------------------------|\n| -l\u003cbr\u003e--logs               | -l\u003cbr\u003e--logs                             | Display container logs.                      |\n| -s\u003cbr\u003e--shell              | -s\u003cbr\u003e--shell                            | Open a shell for the container.              |\n\n\u003cbr\u003e\n\n### PVC\n\u003e heavyscript pvc [Optional Flag]\n\n| Flag                       | Example                                  | Description                                  |\n|----------------------------|------------------------------------------|----------------------------------------------|\n| -m\u003cbr\u003e--mount              | -m\u003cbr\u003e--mount                            | Open a menu to mount PVCs.                   |\n| -u\u003cbr\u003e--unmount            | -u\u003cbr\u003e--unmount                          | Unmount all mounted PVCs.                    |\n\n\u003cbr\u003e\n\n### Self-Update\n\u003e heavyscript self-update\n\n| Flag       | Example            | Description                               |\n|------------|--------------------|-------------------------------------------|\n| --major    | --major            | Includes major updates when self-updating |\n\n\u003cbr\u003e\n\n### Sync\n\u003e heavyscript sync\n\nSyncs the catalog.\n\n\u003cbr\u003e\n\n### Update\n\u003e heavyscript update [Flags]\n\n| Flag                     | Example                                  | Parameter        | Description                                                                                                                                                                |\n|--------------------------|------------------------------------------|------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| -a\u003cbr\u003e--include-major    | -a\u003cbr\u003e--include-major                    |                  | Update the application even if it is a major version update                                                                                                                |\n| -b\u003cbr\u003e--backup           | -b 14\u003cbr\u003e--backup 14                     | Integer          | Take a backup, and set the number of backups to keep                                                                                                                       |\n| -c\u003cbr\u003e--concurrent       | -c 5\u003cbr\u003e--concurrent 5                   | Integer          | How many applications to concurrently update (default: 1)                                                                                                                  |\n| -i\u003cbr\u003e--ignore           | -i nextcloud,sonarr -i sonarr\u003cbr\u003e--ignore nextcloud --ignore sonarr | String           | Ignore updating the specified application                                                                                                                                  |\n| -I\u003cbr\u003e--ignore-img       | -I\u003cbr\u003e--ignore-img                       |                  | Ignore container image updates                                                                                                                                             |\n| -p\u003cbr\u003e--prune            | -p\u003cbr\u003e--prune                            |                  | Prune unused images after the update                                                                                                                                       |\n| -r\u003cbr\u003e--rollback         | -r\u003cbr\u003e--rollback                         |                  | Roll back to the previous version if update failure                                                                                                                         |\n| -s\u003cbr\u003e--sync             | -s\u003cbr\u003e--sync                             |                  | Sync the catalog prior to updating applications                                                                                                                             |\n| -u\u003cbr\u003e--update-only      | -u nextcloud,sonarr\u003cbr\u003e--update-only nextcloud  | String           | Only update the specified application(s)                                                                                                                                    |\n| -x\u003cbr\u003e--stop             | -x\u003cbr\u003e--stop                             |                  | Stop the application prior to updating (Not recommended)                                                                                                                    |\n| -t\u003cbr\u003e--timeout          | -t 500\u003cbr\u003e--timeout 500                  | Integer          | Set the timeout for the update process in seconds (default: 500)                                                                                                           |\n| -U\u003cbr\u003e--self-update      | -U\u003cbr\u003e--self-update                      |                  | Update HeavyScript itself prior to updating                                                                                                                                 |\n| -v\u003cbr\u003e--verbose          | -v\u003cbr\u003e--verbose                          |                  | Display verbose output\n\n\n\u003cbr\u003e\n\n___\n\n\n## How to Install\n\nHeavyScript can be installed in two different ways depending on your needs and privileges on the system:\n\n### Option 1: Non-Privileged Install (Regular User)\n\n\u003e This installation method is suitable if you don't have root access or prefer not to install HeavyScript with elevated privileges.\n\n**Installation Command:**\n```bash\ncurl -s https://raw.githubusercontent.com/Heavybullets8/heavy_script/main/functions/deploy.sh | bash \u0026\u0026 source \"$HOME/.bashrc\" 2\u003e/dev/null \u0026\u0026 source \"$HOME/.zshrc\" 2\u003e/dev/null\n```\n\n**What This Does:**\n- Downloads and places HeavyScript in your user directory.\n- Makes HeavyScript executable.\n- Allows you to run HeavyScript from any directory using `heavyscript`.\n\n**Note:** \n- Without root privileges, the script will not create a system-wide symlink in `/usr/local/bin`.\n- You might see a warning message indicating the lack of root privileges. You can proceed without root access, but you'll need to run HeavyScript with root privileges at least once to create the system-wide symlink, if required.\n\n### Option 2: Privileged Install (Root or Sudo)\n\n\u003e If you have root access or can use `sudo`, this method will set up HeavyScript for all users on the system.\n\n**Installation Command:**\n```bash\ncurl -s https://raw.githubusercontent.com/Heavybullets8/heavy_script/main/functions/deploy.sh | sudo bash \u0026\u0026 source \"$HOME/.bashrc\" 2\u003e/dev/null \u0026\u0026 source \"$HOME/.zshrc\" 2\u003e/dev/null\n```\n\n**What This Does:**\n- Installs HeavyScript with root privileges.\n- Creates a system-wide symlink in `/usr/local/bin`, making HeavyScript accessible to all users.\n- Downloads and places HeavyScript in the root directory (`/root`).\n- Makes HeavyScript executable and accessible system-wide.\n\n**Note:**\n- This method requires root access or sudo privileges.\n- It's recommended for environments where HeavyScript needs to be accessible to multiple users.\n\n---\n\n### Choosing the Right Option:\n\n- **Non-Privileged Install:** Choose this if you're more concerened with security and want to keep HeavyScript isolated to your user account, at least during the initial setup.\n- **Privileged Install:** Choose this if you are less concerened about security and want to make HeavyScript accessible to all users on the system, including the root and sudo user. \n\n\u003cbr\u003e\n\n___\n \n## How to Update\n\n### While Updating\n\n```bash\nheavyscript update --self-update [OPTIONS]\n```\n\n### Direct\n\n```bash\nheavyscript self-update\n```\n\nself-update will update HeavyScript to the latest release, regardless of the branch or tag you're on, and allows you to use any other arguments.\n\n\u003cbr\u003e\n\n___\n\n## Configuration File\n\n### Purpose\n\nThe configuration file is generated the first time the script is run. You can edit it using nano:\n\n```bash\nnano ~/heavy_script/config.ini\n```\n\nModifications in the config file will become the script's defaults. \n\nFor example, if you set sync to true under the [UPDATE] section, running `heavyscript update` will sync the catalog without specifying `--sync` or `-s` in the CLI.\n\n\u003cbr\u003e\n\n### Disabling the Configuration\n\nTo disable the configuration for a specific run of the script, use:\n\n```bash\nheavyscript --no-config\n```\n\nThis will ignore the configuration file for that run.\n\n\u003cbr\u003e\n\n___\n\n## Cron Jobs\n\n### How to Create a Cron Job\n\nTo automate tasks using HeavyScript, you can create a cron job. Here's how to set it up in TrueNAS SCALE:\n\n1. Navigate to the TrueNAS SCALE GUI.\n2. Go to **System Settings** \u003e **Advanced**.\n3. Click on **Cron Jobs**.\n4. Click **Add** to create a new cron job.\n\n![image](https://user-images.githubusercontent.com/20793231/229404447-6836ff1f-ba28-439e-99fe-745371f0f24c.png)\n\n### Important Note on the Command Path\nThe command for the cron job should use the full path to the `heavy_script.sh` file. This path depends on the user who installed HeavyScript. For instance, if you installed HeavyScript as a non-root user, replace `/root` with your home directory path.\n\n\u003e You can find your home directory path by running `echo $HOME` in the terminal.\n\n### Cron Job Settings\n\n- **Command:** Use the full command with the correct path, as shown in the examples above. The `bash` prefix and the full path are required for proper execution.\n- **Run as:** Use `root`, the extra permissions are required for most heavyscript functions.\n- **Schedule:** Choose the frequency and time for the script to run. For example, daily at 4:00 AM.\n- **Hide Standard Output/Error:** Uncheck these options if you wish to receive email notifications about the cron job's output and errors.\n\n### My Personal Cron Job\n\nHere's an example of how I set up my personal cron job:\n\n```\nbash /root/heavy_script/heavy_script.sh update --backup 14 --concurrent 10 --prune --rollback --sync --self-update\n```\n\n\u003e Remember to adjust the path in the command based on where HeavyScript is installed and the user account used for installation.\n","funding_links":[],"categories":["bash"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FHeavybullets8%2Fheavy_script","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FHeavybullets8%2Fheavy_script","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FHeavybullets8%2Fheavy_script/lists"}