Initial commit

This commit is contained in:
Eric Torres 2019-02-07 23:19:21 -08:00
commit a3717ce355
7 changed files with 130 additions and 0 deletions

33
PKGBUILD Normal file
View File

@ -0,0 +1,33 @@
# Maintainer: Eric Torres <erictorres4@protonmail.com>
pkgname=rbackup
pkgver=0
pkgrel=1
pkgdesc="An rsync-based tool for backing up files"
arch=('any')
url=""
license=('MIT')
groups=()
depends=('python')
makedepends=('git' 'python-setuptools')
checkdepends=('python-pytest')
backup=()
source=("file:///${HOME}/Projects/rbackup")
noextract=()
pkgver() {
cd "$srcdir/${pkgname%-git}"
printf "%s" "$(git describe --long | sed 's/\([^-]*-\)g/r\1/;s/-/./g')"
}
build() {
cd "$srcdir/${pkgname}"
python setup.py build
}
package() {
cd "$srcdir/${pkgname%-git}"
# install main package
python setup.py install --prefix='/usr' --root="${pkgdir}" --optimize=1 --skip-build
}

0
README.rst Normal file
View File

1
bin/backup Normal file
View File

@ -0,0 +1 @@
#!/usr/bin/python3

View File

@ -0,0 +1,36 @@
## This config file is read by the backup script
## Only absolute paths are supported
## Paths with spaces must be quoted to avoid word splitting
[main]
## Compression algorithm to use (default is auto,zstd)
## Consult 'borg help compression' for more information
compression = auto,zstd
# Default options to pass to rsync
DefaultOptions = --delete
# Exclude cache directories (directories with a CACHEDIR.TAG file)
ExcludeCaches = yes
## Names to give to the archives (consult borg manual for more)
[names]
HomeArchivename = home-{utcnow}
PkgArchivename = pacman-{utcnow}
SystemArchivename = system-{utcnow}
[paths]
HomePaths = /home /root
PkgPaths = /etc/pacman.conf
/etc/pacman.d
/var/lib/pacman
/var/log/pacman.log
SystemPaths = /boot/loader /etc /var/lib
## Settings for backup-prune
[prune]
KeepHourly=1
KeepDaily=1
KeepWeekly=1
KeepMonthly=1
KeepYearly=1

View File

@ -0,0 +1,10 @@
# Paths to be excluded from home directory backup by default
# Blank lines, and lines beginning with # or ; will be ignored
# Use relative paths
# -----------------------------------
# Default files to be excluded
# -----------------------------------
.cache
.esd_auth
.Xauthority

View File

@ -0,0 +1,28 @@
# Paths to be excluded from backup by default
# Blank lines, and lines beginning with # or ; will be ignored
# Use relative paths
# Regular expressions are valid and can be used
# -----------------------------------
# Default files from /etc to be excluded
# -----------------------------------
ca-certificates
fonts
*fstab*
*group*
hostname
hosts
mtab
os-release
*passwd*
*shadow*
resolv.conf*
ssl
systemd/system
systemd/user
xdg
xml
# -----------------------------------
# User-included paths
# -----------------------------------

22
setup.py Normal file
View File

@ -0,0 +1,22 @@
import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="rbackup",
version="0.0.1",
author="Eric Torres",
author_email="erictorres4@protonmail.com",
description="An rsync-based tool for creating backups",
long_description=long_description,
long_description_content_type="text/markdown",
url="",
packages=setuptools.find_packages(),
scripts=['bin/backup'],
classifiers=[
"Programming Language :: Python :: 3",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
],
)