Provides customizable shell scripts for the automated backup of UNIX-based operation systems. These scripts are useful when you have available remote server storage you can backup your primary system too.
Uses rsync for reliable, compressed, and fast backups.
Uses date/time-stamped backup folders by default.
Enforces backup limits so only a max number of backups can exist.
Supports automatic full and incremental backups.
Supports customizable settings for defining the local machine and remote server to backup to.
Supports customizable file manifest (include list) for defining what files and directories to backup.
A UNIX-system capable of running rsync.
Knowledge of shells, scripting, cron, and SSH.
To install, run:
git clone https://github.com/bkuhlmann/archiver.git cd archiver git checkout 7.0.1
Type the following from the command line to run:
bin/run script will present the following options:
s: Setup current machine. b: Backup to remote server. c: Clean backups (enforces backup limit). q: Quit/Exit.
The options prompt can be skipped by passing the desired option directly to the
For example, executing
bin/run s will perform setup for the current machine.
Applying machine-specific settings is required prior to performing a backup. The shell script (see Usage section below for details) will install templates to get you started but will require further customization. The following is a breakdown of each setting file and how to use it:
$HOME/.config/archiver/settings.sh- Informs the Archiver how and where to perform the backup (see the settings/settings.sh.example file for examples). It consists of the following settings:
BACKUP_NAME- The name used for each backup (in this case a datetime). Example: 2013-01-15_10-30-55.
BACKUP_USER- The user account name used for both the current machine and backup server.
BACKUP_MACHINE- The name of machine to be backed up. This is also used to create the root folder for all machine backups and related logs.
BACKUP_SERVER- The backup server network name or IP address (where all backups will be stored).
BACKUP_ROOT- Root path for all backup folders on backup server for current machine.
BACKUP_LIMIT- The max number of backups to keep at a time.
$HOME/.config/archiver/manifest.txt- Defines all files to be backed up (include list). Use absolute file/directory paths based off the root directory (i.e.
/). See the settings/manifest.txt.example file for examples.
Once backups are configured and running properly, add this script to your crontab for daily backup automation. Example:
- 1 - - - cd $HOME/Dropbox/Development/archiver && bin/run b 2>&1
…which translates to running the script at 1am every morning.
To bypass the password prompt, install your public key on the backup server so cron does not have authentication issues when performing a backup (assuming you have a public key located at the following location):
…you can then perform the following to install it on the backup server (assumes an authorized_key file does not already exists):
scp ~/.ssh/id_rsa.pub email@example.com:.ssh/authorized_keys
For more info on SSH key generation, check out the GitHub Generating SSH Keys page.
SSH Connection Closed - If using a macOS backup server this will happen when the user you are logging in as doesn’t have remote access permission. Here are the steps to fix:
Login to the OSX backup server.
Open System Preferences
Click on Sharing.
Enable Remote Login and Remote Management for all users or just the users you want to allow for backup access.
Rsync Error 23 - If you see this in the backup log, it is most likely because the source file/directory no longer exists. Update your manifest.txt to fix accordingly.
To contribute, run:
git clone https://github.com/bkuhlmann/archiver.git cd archiver
Read Semantic Versioning for details. Briefly, it means:
Major (X.y.z) - Incremented for any backwards incompatible public API changes.
Minor (x.Y.z) - Incremented for new, backwards compatible, public API enhancements/fixes.
Patch (x.y.Z) - Incremented for small, backwards compatible, bug fixes.
Code of Conduct
Read Code of Conduct for details.
Read Contributions for details.
Read License for details.
Read Changes for details.
Engineered by Brooke Kuhlmann.