--- /dev/null
+PREFIX=/usr
+# Where the script binary should go
+BINPATH = $(PREFIX)/bin
+# Where the manpage should go
+MANPATH = $(PREFIX)/share/man
+CONFFILE = /etc/shbackup.conf
+
+######################################################################
+
+all:
+
+install: all
+ install -m 0755 shbackup $(BINPATH)/shbackup
+ install -m 0644 shbackup.conf $(CONFFILE)
+ install -m 0644 shbackup.1 $(MANPATH)/man1/shbackup.1
+
def __str__(self):
return "[name: " + self.name + ", dirs: " + str(self.dirs) + "]"
- formats = ["tar.gz", "tar.bz2", "tar.xz" ]
+ formats = ["tar", "tar.gz", "tar.bz2", "tar.xz" ]
# Filename where checksum of config is saved
checksumfn = "checksum"
print(" prune prune outdated/old backups")
print("")
print("Options:")
- print(" -C <configfile> use given configuration file")
+ print(" -h, --help print this usage text")
+ print(" -c, --conf <configfile> use given configuration file")
print(" default: /etc/shbackup.conf")
- print(" -m, --mode <mode> override mode: full, diff, or incr")
print(" -e, --epoch <epoch> force to create backup for given epoch:")
print(" year, month, week, day, hour, sporadic")
- print(" -h, --help print this usage text")
+ print(" -m, --mode <mode> override mode: full, diff, or incr")
if __name__ == "__main__":
printUsage()
exit(0)
- elif opt in ["-C", "--config"]:
+ elif opt in ["-c", "--conf"]:
i += 1
conffn = sys.argv[i]
--- /dev/null
+'\" -*- coding: us-ascii -*-
+.if \n(.g .ds T< \\FC
+.if \n(.g .ds T> \\F[\n[.fam]]
+.de URL
+\\$2 \(la\\$1\(ra\\$3
+..
+.if \n(.g .mso www.tmac
+.TH shbackup 1 2012-05-13 "" ""
+.SH NAME
+shbackup \- a simple backup solution
+.SH SYNOPSIS
+'nh
+.fi
+.ad l
+\fBshbackup\fR \kx
+.if (\nx>(\n(.l/2)) .nr x (\n(.l/5)
+'in \n(.iu+\nxu
+[options] {\fIcommand\fR}
+'in \n(.iu-\nxu
+.ad b
+'hy
+.SH DESCRIPTION
+\fBshbackup\fR is a simple backup solution
+which packs user-defined file sets with tar. Each
+backup belongs to an epoch, which can be year, month,
+week, day, hour or sporadic. The backup can be made
+either full, differential or incremental.
+\fBshbackup\fR takes care for pruning old
+backups. The user defines for each epoch the number of
+backups to keep, except for 'sporadic'. Sporadic
+backups need to be removed manually.
+.SH COMMANDS
+.TP
+\*(T<\fBbackup\fR\*(T>
+Make a backup
+.TP
+\*(T<\fBlist\fR\*(T>
+List all backups
+.TP
+\*(T<\fBprune\fR\*(T>
+Prune outdated/stale backups
+.SH OPTIONS
+.TP
+\*(T<\fB\-h, \-\-help\fR\*(T>
+Print out a help summary.
+.TP
+\*(T<\fB\-c, \-\-conf FILE\fR\*(T>
+Use given configuration file instead of
+/etc/shbackup.conf.
+.TP
+\*(T<\fB\-e, \-\-epoch EPOCH\fR\*(T>
+Do not determine epoch automatically, but
+use EPOCH, which can be year, month,
+week, day, hour, sporadic.
+.TP
+\*(T<\fB\-m, \-\-mode MODE\fR\*(T>
+Instead of configured mode use MODE,
+which can be full, diff or incr.
+.SH AUTHOR
+Stefan HUBER
--- /dev/null
+[destination]
+# Where shbackup stores the backups and other stuff
+directory = ./backup
+# Which format should be used by tar?
+# One of tar, tar.gz, tar.bz2, tar.xz
+format = tar.gz
+
+
+[history]
+# keepEPOCH contains the number of backups that are kept for that particular
+# epoch, where EPOCH can be year, month, week, day, or hour. modeEPOCH defines
+# the backup mode for that particular epoch. Mode can be full, diff or incr.
+keephour = 1
+keepday = 14
+keepweek = 2
+keepmonth = 12
+keepyear = 2
+modehour = incr
+modeday = diff
+modeweek = full
+modemonth = full
+modeyear = full
+
+
+[input]
+# exclude* contains --exclude patterns for tar. Files matching the pattern are
+# not included into the backup.
+exclude1 = */tmp/*
+exclude2 = */[Cc]cache/*
+exclude3 = */log*
+exclude5 = /home/*/.wine/*
+exclude7 = /lib/layman/*
+
+# A file set called 'home'. Each file set is packed into one archive using tar.
+[set home]
+# dir* is one directory which belongs to this file set.
+dir1 = /home/username/
+dir2 = /media/books/
+
+[set conf]
+dir1 = /etc/
+
+
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+
+<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook V4.4//EN"
+"file:///usr/share/xml/docbook/schema/dtd/4.4/docbookx.dtd"
+[]>
+
+<refentry>
+
+ <refentryinfo>
+ <author>
+ <firstname>Stefan</firstname>
+ <surname>Huber</surname>
+ </author>
+ <date>2012-05-13</date>
+ </refentryinfo>
+
+ <refmeta>
+ <refentrytitle>shbackup</refentrytitle>
+ <manvolnum>1</manvolnum>
+ </refmeta>
+
+ <refnamediv>
+ <refname>shbackup</refname>
+ <refpurpose>a simple backup solution</refpurpose>
+ </refnamediv>
+
+ <refsynopsisdiv>
+ <cmdsynopsis>
+ <command>shbackup</command>
+ <arg>options</arg>
+ <arg choice="req"><replaceable>command</replaceable></arg>
+ </cmdsynopsis>
+ </refsynopsisdiv>
+
+ <refsect1>
+ <title>DESCRIPTION</title>
+
+ <para>
+ <command>shbackup</command> is a simple backup solution
+ which packs user-defined file sets with tar. Each
+ backup belongs to an epoch, which can be year, month,
+ week, day, hour or sporadic. The backup can be made
+ either full, differential or incremental.
+
+ <command>shbackup</command> takes care for pruning old
+ backups. The user defines for each epoch the number of
+ backups to keep, except for 'sporadic'. Sporadic
+ backups need to be removed manually.
+ </para>
+
+ </refsect1>
+
+ <refsect1>
+ <title>COMMANDS</title>
+
+ <variablelist>
+
+ <varlistentry>
+ <term><option>backup</option></term>
+ <listitem>
+ <para>Make a backup</para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option>list</option></term>
+ <listitem>
+ <para>List all backups</para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option>prune</option></term>
+ <listitem>
+ <para>Prune outdated/stale backups</para>
+ </listitem>
+ </varlistentry>
+
+ </variablelist>
+ </refsect1>
+
+
+ <refsect1>
+ <title>OPTIONS</title>
+
+ <variablelist>
+
+ <varlistentry>
+ <term><option>-h, --help</option></term>
+ <listitem>
+ <para>Print out a help summary.</para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option>-c, --conf FILE</option></term>
+ <listitem>
+ <para>Use given configuration file instead of
+ /etc/shbackup.conf.</para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option>-e, --epoch EPOCH</option></term>
+ <listitem>
+ <para>Do not determine epoch automatically, but
+ use EPOCH, which can be year, month,
+ week, day, hour, sporadic.</para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option>-m, --mode MODE</option></term>
+ <listitem>
+ <para>Instead of configured mode use MODE,
+ which can be full, diff or incr.</para>
+ </listitem>
+ </varlistentry>
+
+ </variablelist>
+ </refsect1>
+
+ <refsect1>
+ <title>AUTHOR</title>
+
+ <para>
+ Stefan HUBER
+ </para>
+ </refsect1>
+</refentry>