Skip to content

A collection of bash scripts for automated system and file backups with cloud storage integration.

Notifications You must be signed in to change notification settings

jaredraga/Automatic-Backups

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Automatic Backups

A collection of bash scripts for automated system and file backups with cloud storage integration.

Scripts Overview

backup

The main backup script with comprehensive backup capabilities:

  • Creates compressed tar.xz archives of important system files and directories
  • Syncs backups to multiple cloud storage providers (Google Drive, OneDrive)
  • Performs USB and HDD backups when devices are connected
  • Manages backup retention by maintaining a specified number of backups
  • Handles KeePass database syncing
  • Includes system restoration capabilities

Usage:

# Basic backup
sudo backup

# USB backup only
sudo backup usb

# HDD backup only  
sudo backup hdd

# Both USB and HDD backup
sudo backup usb hdd

# Backup scripts directory only
sudo backup usb scripts
sudo backup hdd scripts

# Restore from backup
sudo backup restore backup.tar.xz

# Quick KeePass database backup
sudo backup kdbx

# Quiet mode (minimal notifications)
sudo backup usb q

backup-cp

A simpler backup script focused on daily backups:

  • Archives and compresses specified folders
  • Syncs to cloud storage (Google Drive, OneDrive)
  • Manages backup retention
  • Backs up Linux configuration files
  • Syncs KeePass databases
  • Handles Google Takeout backups

Usage:

./backup-cp

backup-photos

A dedicated script for photo backup:

  • Syncs personal photos to multiple cloud services (MEGA, Google Drive, Dropbox)
  • Includes dry-run functionality to preview changes
  • Provides notifications for sync status
  • Handles deletion synchronization

Usage:

./backup-photos

backup-dir

A utility script for creating local directory backups:

  • Creates a backup copy of a specified directory
  • Maintains permissions during backup
  • Includes timestamp and backup information
  • Useful for quick local backups before making changes

Usage:

./backup-dir /path/to/directory

backup-usb.sh

A script for USB drive backups:

  • Automatically mounts USB devices
  • Syncs local backups to USB drive
  • Handles books and other specified directories
  • Ensures proper unmounting after backup

Usage:

./backup-usb.sh device_name  # e.g., sdb1

puppy.sh

A specialized backup script for Puppy Linux:

  • Backs up Flash Player shared objects
  • Handles KeePass configuration backup
  • Manages game save files
  • Useful for maintaining persistent data in Puppy Linux

Usage:

# Backup macromedia files
./puppy.sh backup

# Restore and launch application
./puppy.sh

Configuration

All scripts have configurable variables at the top of their files:

  • Backup retention period
  • Backup directories
  • Cloud storage paths
  • Notification settings
  • File naming conventions

Features

  • Automated error checking and integrity verification
  • System notifications for backup status
  • Cloud storage integration
  • USB/HDD device detection
  • Backup rotation and cleanup
  • System restoration capabilities
  • Linux configuration backup
  • KeePass database syncing
  • Google Takeout integration
  • Photo backup management
  • Local directory backup utilities

Requirements

  • rclone (configured for cloud storage)
  • tar
  • notify-send
  • sudo privileges
  • rsync
  • Properly configured cloud storage credentials
  • Flash Player (for puppy.sh)
  • KeePassXC (for relevant backup features)

Installation

  1. Place scripts in a directory in your PATH
  2. Make them executable:
chmod +x backup backup-cp backup-photos backup-dir backup-usb.sh puppy.sh
  1. Configure cloud storage using rclone
  2. Adjust variables in scripts as needed
  3. Set up scheduled tasks if desired
  4. Configure udev rules for USB backup if needed

Notes

  • Scripts require sudo privileges for system file access
  • Cloud storage must be configured via rclone before use
  • USB/HDD backup requires proper device detection
  • Backup restoration should be done carefully to avoid data loss
  • Some scripts are designed for specific environments (e.g., puppy.sh for Puppy Linux)
  • Always test backup and restore procedures in a safe environment first

About

A collection of bash scripts for automated system and file backups with cloud storage integration.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages