Go to file
Heavybullets8 b4e5b45045
Backport Truescript Changes
1. Arguments can be used in any order now (Thanks Ornias)

2. Rollback applications feature (Ornias' Idea, again thank you)
- When using -R 
        The script will monitor the status of the application after updating it, make sure it deploys, if the app does not deploy within the timeout, roll the application back

3. Ability to stop applications prior to updating with -S (another idea by ornias)

4. Option for verbose output with -v
I made this change after adding the new features, it makes the output ugly, but figured id give the users the choice to see more information.

5. Better variable names

6. A ton of other various little fixes and testing
You can view the current work, and who exactly did what, and when with this link:
https://github.com/truecharts/truescript/commits/optimise

My current un-pulled Pull Request:
https://github.com/truecharts/truescript/pull/5
2022-05-10 03:54:31 +00:00
heavy_script.sh Backport Truescript Changes 2022-05-10 03:54:31 +00:00
LICENSE Initial commit 2022-04-21 21:18:27 +00:00
README.md Add personal Cron Job 2022-04-28 01:39:44 +00:00

heavy_script

Script that can: Update Truenas SCALE applications, Mount and unmount PVC storage, Prune Docker images.

These arguments NEED to be ran in a specific order, you can go from TOP to BOTTOM, see example below

  • -m | Initiates mounting feature, choose between unmounting and mounting PVC data"
  • -r | Opens a menu to restore a HeavyScript backup that was taken on you ix-applications pool"
  • -b | Back-up your ix-applications dataset, specify a number after -b"
  • -i | Add application to ignore list, one by one, see example below."
  • -t | Set a custom timeout in seconds for -u or -U: This is the ammount of time the script will wait for an application to go from DEPLOYING to ACTIVE"
  • -t | Set a custom timeout in seconds for -m: Amount of time script will wait for applications to stop, before timing out"
  • -s | sync catalog"
  • -U | Update all applications, ignores versions"
  • -u | Update all applications, does not update Major releases"
  • -p | Prune unused/old docker images"

Examples

bash heavy_script.sh -b 14 -i portainer -i arch -i sonarr -i radarr -t 600 -sup

  • This is your typical cron job implementation.

  • -b is set to 14. Up to 14 snapshots of your ix-applications dataset will be saved

  • -i is set to ignore portainer, arch, sonarr, and radarr. These applications will be ignored when it comes to updates.

  • -t I set it to 600 seconds, this means the script will wait 600 seconds for the application to become ACTIVE before timing out and continuing to a different application.

  • -s will just sync the repositories, ensuring you are downloading the latest updates

  • -u update applications as long as the major version has absolutely no change, if it does have a change it will ask the user to update manually.

  • -p Prune docker images.

  • bash /mnt/tank/scripts/heavy_script.sh -t 8812 -m

  • bash /mnt/tank/scripts/heavy_script/heavy_script.sh -r

My personal Cron Job

  • git -C /mnt/speed/scripts/heavy_script pull && bash /mnt/speed/scripts/heavy_script/heavy_script.sh -b 14 -sup