Backup directories & files from one machine to another.

Marcus Rohrmoser ab171a2434 add a doap 5 months ago
destination 6d167b030a use t=0 as time-reference 4 years ago
source bb3c910abb .🌀. 2 years ago
.gitignore 55d298c2ab initial 4 years ago
LICENSE da1627b87c license 4 years ago
README.creole bb3c910abb .🌀. 2 years ago
doap.rdf ab171a2434 add a doap 5 months ago


Backup directories & files from one machine to another.

Storage inspired by [[|Apples Time Machine]],
transfer using [[|ssh]] and [[|rsync]].

Pushes backups so root can trigger the backup **all(!)** files - no matter how
permissions are set.

Uses hardlinks on the destination machine to save space for unchanged files.

== Backup destination ==

That's the machine that stores the backups. Ensure there's enough disk space,
as there's no pre-flight purging of old backups when running out of space as you may be
used to from time machine.

Example: {{{}}}

# create a user to receive & store the backups:\\
{{{$ sudo adduser --home /.../Backups.backupdb backup-store}}}
# {{{$ sudo su - backup-store}}}
# {{{$ mkdir $HOME/.ssh ; chmod 700 $HOME/.ssh}}}
# append the ssh-key of each remote user {{{}}} to receive backups from to
# put the //backup finish script// in place (see below),
# optional: add the //date filter script// (also see below).

That's pretty much it.

== Backup source ==

That's the machine you want to back up stuff from.

Example: {{{}}}

# prepare the //backup push script// named {{{}}} (see below),
# add a {{{}}} file alongside the script (see [[|rsync --exclude-from=]]),
# create a ssh-key and transfer it to the destination machine (-> {{{$HOME/.ssh/authorized_keys}}})\\
{{{$ ssh-keygen -t rsa -b 4096 -f $HOME/.ssh/}}},
# add a cron job calling the //backup push script// repeatedly:\\
{{{$ crontab -l -u root | grep backup-store}}}\\
{{{57 4 * * * nice dash 2>&1 1>> /var/log/}}}

== Scripts ==

=== backup push script (bash/dash) ===

On backup source machine (can run without adjustment):


=== backup finish script (bash/dash) ===

On backup destination machine (no adjustment needed):


=== date filter script (lua) ===


Decide which backups to keep and which to remove based on time criteria.

On backup destination machine (no adjustment needed), requires [[|lua]]: