Skip to content

Jarsky/Ubuntu-Server-Update-Script

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Ubuntu-Server-Update-Script

These scripts are to automate the backup and update of a headless Ubuntu Server.
Written predominantly to use with my Raspberry Pi's due to being unable to Snapshot them.

Prerequisites

  1. Must have an SMTP relay configured for Email Notifications.
  2. Requires sendemail to be installed sudo apt install sendemail
  3. Requires TS to be installed sudo apt install moreutils

Usage

Clone the repository to a location e.g ~/scripts
Create the appropriate CRON jobs
Make sure to give enough time between backup and update

sudo crontab -e

#Run Full Backup
30 2 * * WED /path/to/scripts/Ubuntu-Server-Update-Script/backup-pi.sh
#Update & Reboot Check
0 3 * * WED /path/to/scripts/Ubuntu-Server-Update-Script/upgrade-all.sh

Important Notes

  • The Backup script you will need to manually configure the paths you want to backup.
    The default included paths are /opt for Docker and /home/ubuntu for the default Ubuntu users home

  • The Backup script will check if a file named check exists at the mounted backup location. This is to ensure that backups are being saved to a properly mounted volume. As this is primarily for the backup of Raspberry Pi's which are common for SDCards to fail suddenly and completely, we need to ensure these backups are being offloaded to a network share.

  • If your backup folder is /mnt/backup then the check file should be created at /mnt/backup/check.
    e.g touch /mnt/backup/check then ensure you can see this file on your network share.
    If the script cannot find this file (such as if the mount as failed), it will attempt to re-mount and will send a notification (if Email is enabled).

  • The upgrade script supports stopping docker containers (excluding Portainer) before restart.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages