A collection of bash scripts for automated system and file backups with cloud storage integration.
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
# 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 qA 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
./backup-cpA 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
./backup-photosA 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
./backup-dir /path/to/directoryA 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
./backup-usb.sh device_name # e.g., sdb1A 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
# Backup macromedia files
./puppy.sh backup
# Restore and launch application
./puppy.shAll scripts have configurable variables at the top of their files:
- Backup retention period
- Backup directories
- Cloud storage paths
- Notification settings
- File naming conventions
- 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
- 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)
- Place scripts in a directory in your PATH
- Make them executable:
chmod +x backup backup-cp backup-photos backup-dir backup-usb.sh puppy.sh- Configure cloud storage using rclone
- Adjust variables in scripts as needed
- Set up scheduled tasks if desired
- Configure udev rules for USB backup if needed
- 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