Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/bkuhlmann/archiver

Shell scripts for automated backup of UNIX-based operation systems.
https://github.com/bkuhlmann/archiver

backup shell

Last synced: 11 days ago
JSON representation

Shell scripts for automated backup of UNIX-based operation systems.

Awesome Lists containing this project

README

        

:toc: macro
:toclevels: 5
:figure-caption!:

= Archiver

⚠️ *This project is deprecated and will be fully destroyed on 2025-03-05.* ⚠️

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.

toc::[]

== Features

* 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.

== Requirements

. A UNIX-system capable of running rsync.
. Knowledge of shells, scripting, cron, and SSH.

== Setup

To install, run:

[source,bash]
----
git clone https://github.com/bkuhlmann/archiver.git
cd archiver
git checkout 9.1.1
----

== Usage

Type the following from the command line to run:

[source,bash]
----
bin/run
----

Running the `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 `bin/run` script.
For example, executing `bin/run s` will perform setup for the current machine.

=== Configuration

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.

=== Cron

Once backups are configured and running properly, add this script to your
link:https://en.wikipedia.org/wiki/Crontab[crontab] for daily backup automation. Example:

[source,bash]
----
* 1 * * * cd $HOME/Dropbox/Development/archiver && bin/run b 2>&1
----

...which translates to running the script at 1am every morning.

=== SSH

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):

[source,bash]
----
~/.ssh/id_rsa.pub
----

...you can then perform the following to install it on the backup server (assumes an authorized_key
file does not already exists):

[source,bash]
----
scp ~/.ssh/id_rsa.pub [email protected]:.ssh/authorized_keys
----

That's it!

For more info on SSH key generation, check out the
link:https://help.github.com/articles/generating-ssh-keys[GitHub Generating SSH Keys] page.

=== Troubleshooting

* 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.

== Development

To contribute, run:

[source,bash]
----
git clone https://github.com/bkuhlmann/archiver.git
cd archiver
----

== link:https://alchemists.io/policies/license[License]

== link:https://alchemists.io/policies/security[Security]

== link:https://alchemists.io/policies/code_of_conduct[Code of Conduct]

== link:https://alchemists.io/policies/contributions[Contributions]

== link:https://alchemists.io/projects/archiver/versions[Versions]

== link:https://alchemists.io/community[Community]

== Credits

Engineered by link:https://alchemists.io/team/brooke_kuhlmann[Brooke Kuhlmann].