Skip to content

About

Repository containing Bash scripts for VM testing and deployment

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

10 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Bash Scripts Repository

The scripts in this repo start as either assignments from class or ideas that I want to practice and implement in my homelab.

  1. weather.sh - This script started as a class bonus assignment. It is designed to give the user a different response depending on temperature. It prompts the user for a temperature between -128 degrees and 134 degrees. It then responds with "Hot", "Fine", or "Cold" depending if the input is 76 or higher, between 50 and 76, and 50 or lower, respectively.

  2. new_folder.sh - This script was designed to automatically create and rename new directories in the local file system. It first creates the directory with a temporary placeholder name, then prompts user to enter a new name for it. The script then moves the user out of the directory, applies the new name, and then moves the user back in. In the event that the user does not input a new name for the directory, the script applies a default name "New Directory" along with a counter to avoid overwriting any existing folders.

  3. backup.sh - This script started as another class bonus assignment. It is designed to create a backup of the /home directory and all subordinate directories and folders and move them to the destination directory /mnt/backups. The script operates using the tar archiving system, first creating an archive and then compressing it using gzip. The script is designed where, upon successful completion of the process, cleanly prints the size of the archive to the terminal. Any errors recorded by tar during the process are re-directed to a text file, backup_log.txt which is added to the destination directory.

  4. auto_update.sh - This script is designed to automate updates to my Proxmox VE server and check for any required reboots in the event of a kernel update. The script begins by defining a log file path for tracking update history /var/log/proxmox_auto_update.log. It will then echo an exact start time of the maintenance run. All updates are then pulled from a pve-no-subscription repository and installed non-interactively. The script then automatically removes orphaned dependencies and any unused packages to help conserve space in the root directory where the script lives. In the event that the system requires a reboot, such as for a kernel upgrade, the if statement in the script will broadcast a live terminal alert to any active SSH or console session ensuring that the user is notified even when operating in a VM or container. Once complete, the script finalizes by echoing the completion timestamp. Since my server is turned off when not actively in use, I currently have the script scheduled via anacron to execute every 7 days with a 5 minute boot delay.

About

Repository containing Bash scripts for VM testing and deployment

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages