From 3334f89b94dfc320e9a6daa7ff4d18b35c787b20 Mon Sep 17 00:00:00 2001 From: dave Date: Wed, 2 Oct 2024 12:49:33 -0400 Subject: [PATCH] Adding FIles --- backup.sh | 35 +++++++++++++++++++++++++++++++++++ gitupdate.sh | 10 ++++++++++ updatesystem.sh | 13 +++++++++++++ 3 files changed, 58 insertions(+) create mode 100755 backup.sh create mode 100755 gitupdate.sh create mode 100755 updatesystem.sh diff --git a/backup.sh b/backup.sh new file mode 100755 index 0000000..8d20c48 --- /dev/null +++ b/backup.sh @@ -0,0 +1,35 @@ +#!/bin/sh +#################################### +# +# Backup to NFS mount script. +# +#################################### + +# What to backup. +backup_files="/home /etc /opt" +# old --- /boot /root /opt + +# Where to backup to. +dest="/SysBackup" + +# Create archive filename. +day=$(date +%A-%m-%d-%Y) +hostname=$(hostname -s) +archive_file="$hostname-$day.tgz" + +# Print start status message. +echo "Backing up $backup_files to $dest/$archive_file" +date +echo + +# Backup the files using tar. +tar czf $dest/$archive_file $backup_files + +# Print end status message. +echo +echo "Backup finished" +date + +# Long listing of files in $dest to check file sizes. +ls -lh $dest + diff --git a/gitupdate.sh b/gitupdate.sh new file mode 100755 index 0000000..4180c6c --- /dev/null +++ b/gitupdate.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +git add . +git status +echo -n "Enter the Description for the Change: " [Minor Update] +read CHANGE_MSG + +git commit -m "${CHANGE_MSG}" +git push origin main +exit diff --git a/updatesystem.sh b/updatesystem.sh new file mode 100755 index 0000000..7618e5c --- /dev/null +++ b/updatesystem.sh @@ -0,0 +1,13 @@ +#!/bin/bash +# if not root, run as root +if (( $EUID != 0 )); then + sudo $HOME/scripts/updatesystem.sh + exit +fi +apt update +apt list --upgradeable +read -p "Press any key to continue... " -n1 -s +apt upgrade -y +#apt-get -y dist-upgrade +apt clean +apt autoremove -y