From b9601cf46a75b373f6b6b902d7ac2be38ab2ffe8 Mon Sep 17 00:00:00 2001 From: Ludovic Pouzenc Date: Tue, 15 Jun 2021 16:45:20 +0200 Subject: borg-family_0.2-1 --- borg-family-0.1/Makefile | 27 --------------- borg-family-0.1/README | 0 borg-family-0.1/debian/borg-family.config | 4 --- borg-family-0.1/debian/borg-family.docs | 1 - borg-family-0.1/debian/borg-family.examples | 1 - borg-family-0.1/debian/borg-family.init | 17 --------- borg-family-0.1/debian/borg-family.manpages | 3 -- borg-family-0.1/debian/borg-family.postinst | 15 -------- borg-family-0.1/debian/borg-family.postrm | 10 ------ borg-family-0.1/debian/borg-family.service | 14 -------- borg-family-0.1/debian/borg-family.substvars | 2 -- borg-family-0.1/debian/borg-family.templates | 8 ----- borg-family-0.1/debian/borg-family.timer | 10 ------ borg-family-0.1/debian/changelog | 5 --- borg-family-0.1/debian/compat | 1 - borg-family-0.1/debian/control | 14 -------- borg-family-0.1/debian/debhelper-build-stamp | 1 - borg-family-0.1/debian/files | 2 -- borg-family-0.1/debian/rules | 3 -- borg-family-0.1/debian/source/format | 1 - borg-family-0.1/doc/examples/envvars | 10 ------ borg-family-0.1/doc/man/bfenv.1 | 1 - borg-family-0.1/doc/man/bfrun.1 | 52 ---------------------------- borg-family-0.1/doc/man/bfwhat.1 | 1 - borg-family-0.1/src/etc/bfhooks | 27 --------------- borg-family-0.1/src/etc/confvars | 5 --- borg-family-0.1/src/etc/excludes.d/home | 4 --- borg-family-0.1/src/etc/excludes.d/rootfs | 5 --- borg-family-0.1/src/sbin/bfenv | 31 ----------------- borg-family-0.1/src/sbin/bfrun | 29 ---------------- borg-family-0.1/src/sbin/bfwhat | 24 ------------- 31 files changed, 328 deletions(-) delete mode 100644 borg-family-0.1/Makefile delete mode 100644 borg-family-0.1/README delete mode 100644 borg-family-0.1/debian/borg-family.config delete mode 100644 borg-family-0.1/debian/borg-family.docs delete mode 100644 borg-family-0.1/debian/borg-family.examples delete mode 100644 borg-family-0.1/debian/borg-family.init delete mode 100644 borg-family-0.1/debian/borg-family.manpages delete mode 100644 borg-family-0.1/debian/borg-family.postinst delete mode 100644 borg-family-0.1/debian/borg-family.postrm delete mode 100644 borg-family-0.1/debian/borg-family.service delete mode 100644 borg-family-0.1/debian/borg-family.substvars delete mode 100644 borg-family-0.1/debian/borg-family.templates delete mode 100644 borg-family-0.1/debian/borg-family.timer delete mode 100644 borg-family-0.1/debian/changelog delete mode 100644 borg-family-0.1/debian/compat delete mode 100644 borg-family-0.1/debian/control delete mode 100644 borg-family-0.1/debian/debhelper-build-stamp delete mode 100644 borg-family-0.1/debian/files delete mode 100755 borg-family-0.1/debian/rules delete mode 100644 borg-family-0.1/debian/source/format delete mode 100644 borg-family-0.1/doc/examples/envvars delete mode 120000 borg-family-0.1/doc/man/bfenv.1 delete mode 100644 borg-family-0.1/doc/man/bfrun.1 delete mode 120000 borg-family-0.1/doc/man/bfwhat.1 delete mode 100755 borg-family-0.1/src/etc/bfhooks delete mode 100644 borg-family-0.1/src/etc/confvars delete mode 100644 borg-family-0.1/src/etc/excludes.d/home delete mode 100644 borg-family-0.1/src/etc/excludes.d/rootfs delete mode 100755 borg-family-0.1/src/sbin/bfenv delete mode 100755 borg-family-0.1/src/sbin/bfrun delete mode 100755 borg-family-0.1/src/sbin/bfwhat (limited to 'borg-family-0.1') diff --git a/borg-family-0.1/Makefile b/borg-family-0.1/Makefile deleted file mode 100644 index ff88bdd..0000000 --- a/borg-family-0.1/Makefile +++ /dev/null @@ -1,27 +0,0 @@ -PKGNAME=borg-family -VERSION=0.1 - -INSTALL=install -INSTALL_PROGRAM=$(INSTALL) -INSTALL_DATA=${INSTALL} -m 644 -confdir=/etc/${PKGNAME} -sbindir=/usr/sbin - -all: - -deb: - cd .. && tar -czf ${PKGNAME}_${VERSION}.orig.tar.gz --exclude debian ${PKGNAME}-${VERSION} - debuild -us -uc - -install: - $(INSTALL) -d $(DESTDIR)$(sbindir) - $(INSTALL) -d $(DESTDIR)$(confdir)/excludes.d - $(INSTALL_PROGRAM) src/sbin/bfenv $(DESTDIR)$(sbindir) - $(INSTALL_PROGRAM) src/sbin/bfrun $(DESTDIR)$(sbindir) - $(INSTALL_PROGRAM) src/sbin/bfwhat $(DESTDIR)$(sbindir) - $(INSTALL_PROGRAM) src/etc/bfhooks $(DESTDIR)$(confdir) - $(INSTALL_DATA) src/etc/confvars $(DESTDIR)$(confdir) - $(INSTALL_DATA) src/etc/excludes.d/home $(DESTDIR)$(confdir)/excludes.d - $(INSTALL_DATA) src/etc/excludes.d/rootfs $(DESTDIR)$(confdir)/excludes.d - -.PHONY: all deb install diff --git a/borg-family-0.1/README b/borg-family-0.1/README deleted file mode 100644 index e69de29..0000000 diff --git a/borg-family-0.1/debian/borg-family.config b/borg-family-0.1/debian/borg-family.config deleted file mode 100644 index d0e4f26..0000000 --- a/borg-family-0.1/debian/borg-family.config +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh -e -. /usr/share/debconf/confmodule -db_input critical borg-family/borg-repo || true -db_go diff --git a/borg-family-0.1/debian/borg-family.docs b/borg-family-0.1/debian/borg-family.docs deleted file mode 100644 index e845566..0000000 --- a/borg-family-0.1/debian/borg-family.docs +++ /dev/null @@ -1 +0,0 @@ -README diff --git a/borg-family-0.1/debian/borg-family.examples b/borg-family-0.1/debian/borg-family.examples deleted file mode 100644 index e002ac5..0000000 --- a/borg-family-0.1/debian/borg-family.examples +++ /dev/null @@ -1 +0,0 @@ -doc/examples/envvars diff --git a/borg-family-0.1/debian/borg-family.init b/borg-family-0.1/debian/borg-family.init deleted file mode 100644 index 72e9267..0000000 --- a/borg-family-0.1/debian/borg-family.init +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/sh -### BEGIN INIT INFO -# Provides: borg-family -# Required-Start: $network $local_fs $syslog -# Required-Stop: $local_fs $syslog -# Default-Start: 2 3 4 5 -# Default-Stop: 0 1 6 -# Short-Description: borg-family backup scripts -# Description: Makes Borg running periodically to backup computers to a remote server -### END INIT INFO - -. /lib/lsb/init-functions - -case "$1" in - start|stop|restart|reload|status|force-reload) - log_action_msg "This is a stub, you shuld run bfrun from cron if not using systemd borg-family.timer" ;; -esac diff --git a/borg-family-0.1/debian/borg-family.manpages b/borg-family-0.1/debian/borg-family.manpages deleted file mode 100644 index 160e2fa..0000000 --- a/borg-family-0.1/debian/borg-family.manpages +++ /dev/null @@ -1,3 +0,0 @@ -doc/man/bfenv.1 -doc/man/bfrun.1 -doc/man/bfwhat.1 diff --git a/borg-family-0.1/debian/borg-family.postinst b/borg-family-0.1/debian/borg-family.postinst deleted file mode 100644 index 5bf8c69..0000000 --- a/borg-family-0.1/debian/borg-family.postinst +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/sh -set -e - -EVFILE=/etc/borg-family/envvars - -if [ "$1" = configure ]; then - . /usr/share/debconf/confmodule - unset BORG_REPO - db_get borg-family/borg-repo && BORG_REPO="$RET" - db_stop - [ -f "$EVFILE" ] || install -m 644 /usr/share/doc/borg-family/examples/envvars "$EVFILE" - [ -n "$BORG_REPO" ] && sed --in-place -e 's#^export BORG_REPO=.*$#export BORG_REPO="'$BORG_REPO'"#' -- "$EVFILE" -fi - -#DEBHELPER# diff --git a/borg-family-0.1/debian/borg-family.postrm b/borg-family-0.1/debian/borg-family.postrm deleted file mode 100644 index 5ae54c6..0000000 --- a/borg-family-0.1/debian/borg-family.postrm +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/sh -set -e - -if [ "$1" = "purge" ]; then - . /usr/share/debconf/confmodule - db_purge - rm -f /etc/borg-family/envvars -fi - -#DEBHELPER# diff --git a/borg-family-0.1/debian/borg-family.service b/borg-family-0.1/debian/borg-family.service deleted file mode 100644 index f6aab42..0000000 --- a/borg-family-0.1/debian/borg-family.service +++ /dev/null @@ -1,14 +0,0 @@ -[Unit] -Description=Makes Borg running periodically to backup computers to a remote server -Wants=default.target network-online.target -ConditionACPower=true - -[Service] -ExecStart=/usr/bin/systemd-inhibit --why="Prevent interrupting backup" /usr/sbin/bfrun -Restart=no -# Lower CPU and I/O priority. -Nice=19 -CPUSchedulingPolicy=batch -IOSchedulingClass=best-effort -IOSchedulingPriority=7 -IOWeight=100 diff --git a/borg-family-0.1/debian/borg-family.substvars b/borg-family-0.1/debian/borg-family.substvars deleted file mode 100644 index a595723..0000000 --- a/borg-family-0.1/debian/borg-family.substvars +++ /dev/null @@ -1,2 +0,0 @@ -misc:Depends=debconf (>= 0.5) | debconf-2.0 -misc:Pre-Depends= diff --git a/borg-family-0.1/debian/borg-family.templates b/borg-family-0.1/debian/borg-family.templates deleted file mode 100644 index b17ce60..0000000 --- a/borg-family-0.1/debian/borg-family.templates +++ /dev/null @@ -1,8 +0,0 @@ -Template: borg-family/borg-repo -Type: string -Description: Borg repository URL: - Please set the backup destination. - . - It will be exported to BORG_REPO by bfrun for borg commands. - Could be 'ssh://user@host:port/abspath/to/repo', or 'user@host:relpath/to/repo', see man borg. - diff --git a/borg-family-0.1/debian/borg-family.timer b/borg-family-0.1/debian/borg-family.timer deleted file mode 100644 index 14a848a..0000000 --- a/borg-family-0.1/debian/borg-family.timer +++ /dev/null @@ -1,10 +0,0 @@ -[Unit] -Description=Run borg-family backup - -[Timer] -OnCalendar=daily -Persistent=true - -[Install] -WantedBy=timers.target - diff --git a/borg-family-0.1/debian/changelog b/borg-family-0.1/debian/changelog deleted file mode 100644 index e2329ed..0000000 --- a/borg-family-0.1/debian/changelog +++ /dev/null @@ -1,5 +0,0 @@ -borg-family (0.1-1) UNRELEASED; urgency=medium - - * Initial release. - - -- Ludovic Pouzenc Sat, 28 Nov 2020 17:07:53 +0100 diff --git a/borg-family-0.1/debian/compat b/borg-family-0.1/debian/compat deleted file mode 100644 index f599e28..0000000 --- a/borg-family-0.1/debian/compat +++ /dev/null @@ -1 +0,0 @@ -10 diff --git a/borg-family-0.1/debian/control b/borg-family-0.1/debian/control deleted file mode 100644 index 3ca323f..0000000 --- a/borg-family-0.1/debian/control +++ /dev/null @@ -1,14 +0,0 @@ -Source: borg-family -Maintainer: Ludovic Pouzenc -Section: admin -Priority: optional -Standards-Version: 4.3.0 -Build-Depends: debhelper (>= 10) - -Package: borg-family -Architecture: all -Depends: bash (>= 2.0), borgbackup (>= 1.0), coreutils (>= 4.0), debconf, gawk, openssh-client, pwgen (>= 2.0), sed (>= 4.0), util-linux (>= 2.0), ${misc:Depends} -Description: Makes Borg running periodically to backup computers to a remote server - borg-family ease the backup automation configuration around Borg - in small environnements, like backuping some computers to a remote - family server. diff --git a/borg-family-0.1/debian/debhelper-build-stamp b/borg-family-0.1/debian/debhelper-build-stamp deleted file mode 100644 index e8dd97e..0000000 --- a/borg-family-0.1/debian/debhelper-build-stamp +++ /dev/null @@ -1 +0,0 @@ -borg-family diff --git a/borg-family-0.1/debian/files b/borg-family-0.1/debian/files deleted file mode 100644 index 225c048..0000000 --- a/borg-family-0.1/debian/files +++ /dev/null @@ -1,2 +0,0 @@ -borg-family_0.1-1_all.deb admin optional -borg-family_0.1-1_amd64.buildinfo admin optional diff --git a/borg-family-0.1/debian/rules b/borg-family-0.1/debian/rules deleted file mode 100755 index cbe925d..0000000 --- a/borg-family-0.1/debian/rules +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/make -f -%: - dh $@ diff --git a/borg-family-0.1/debian/source/format b/borg-family-0.1/debian/source/format deleted file mode 100644 index 163aaf8..0000000 --- a/borg-family-0.1/debian/source/format +++ /dev/null @@ -1 +0,0 @@ -3.0 (quilt) diff --git a/borg-family-0.1/doc/examples/envvars b/borg-family-0.1/doc/examples/envvars deleted file mode 100644 index 99f7139..0000000 --- a/borg-family-0.1/doc/examples/envvars +++ /dev/null @@ -1,10 +0,0 @@ -# To consult or restore backups, just load this file in a root shell environnement variables with: -# source /etc/borg-family/envvars -# Then use commands like: -# borg list -# mkdir /mnt/restore -# borg mount ::somehostname-rootfs-2020-08-15 /mnt/restore -# cp -ai /mnt/restore/rootfs/etc/veryimportantfile /etc/ -export BORG_RSH="ssh -i /etc/borg-family/id_rsa_borg" -export BORG_PASSCOMMAND="cat /etc/borg-family/passphrase" -export BORG_REPO="ssh://user@host:port/path/to/repo" diff --git a/borg-family-0.1/doc/man/bfenv.1 b/borg-family-0.1/doc/man/bfenv.1 deleted file mode 120000 index 080be00..0000000 --- a/borg-family-0.1/doc/man/bfenv.1 +++ /dev/null @@ -1 +0,0 @@ -bfrun.1 \ No newline at end of file diff --git a/borg-family-0.1/doc/man/bfrun.1 b/borg-family-0.1/doc/man/bfrun.1 deleted file mode 100644 index efc42a7..0000000 --- a/borg-family-0.1/doc/man/bfrun.1 +++ /dev/null @@ -1,52 +0,0 @@ -.TH BORG-FAMILY 1 local -.SH NAME -bfrun, bfwhat, bfenv \- scripts to run Borg to backup your computers -.SH SYNOPSIS -.ll +8 -.B bfrun -.ll -8 -.br -.SH DESCRIPTION -.I bfrun -invokes -.I bfenv -then -.I bfwhat -to check repository availability and list local mount points to backup. -.SH OPTIONS -.ll +8 -.B No options. -See /etc/borg-family -.ll -8 -.SH "ENVIRONMENT" -.B bfrun -loads /etc/borg-family/envvars for Borg and /etc/borg-family/confvars for itself. -.SH "SEE ALSO" -borgbackup(1) -.SH CAVEATS -Poor manpage. -.SH BUGS -Reports them to -.BR "" -.SH "COPYRIGHT NOTICE" -Copyright \(co 2020 Ludovic Pouzenc -.PP -Permission is granted to make and distribute verbatim copies of -this manual provided the copyright notice and this permission notice -are preserved on all copies. -.ig -Permission is granted to process this file through troff and print the -results, provided the printed document carries copying permission -notice identical to this one except for the removal of this paragraph -(this paragraph not being relevant to the printed manual). -.. -.PP -Permission is granted to copy and distribute modified versions of this -manual under the conditions for verbatim copying, provided that the entire -resulting derived work is distributed under the terms of a permission -notice identical to this one. -.PP -Permission is granted to copy and distribute translations of this manual -into another language, under the above conditions for modified versions, -except that this permission notice may be stated in a translation approved -by the Foundation. diff --git a/borg-family-0.1/doc/man/bfwhat.1 b/borg-family-0.1/doc/man/bfwhat.1 deleted file mode 120000 index 080be00..0000000 --- a/borg-family-0.1/doc/man/bfwhat.1 +++ /dev/null @@ -1 +0,0 @@ -bfrun.1 \ No newline at end of file diff --git a/borg-family-0.1/src/etc/bfhooks b/borg-family-0.1/src/etc/bfhooks deleted file mode 100755 index 5b6b204..0000000 --- a/borg-family-0.1/src/etc/bfhooks +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/bash -e -mount_bind_rootfs() { - if ! mount | grep -q /rootfs; then - mkdir -p /rootfs - mount --bind / /rootfs - fi -} - -umount_bind_rootfs() { - if mount | grep -q /rootfs; then - umount /rootfs || lsof -n | grep /rootfs - rmdir /rootfs - fi -} - -case $1 in - before) - case $2 in - rootfs) apt-get clean || true; mount_bind_rootfs;; - esac - ;; - after) - case $2 in - rootfs) umount_bind_rootfs ;; - esac - ;; -esac diff --git a/borg-family-0.1/src/etc/confvars b/borg-family-0.1/src/etc/confvars deleted file mode 100644 index f737648..0000000 --- a/borg-family-0.1/src/etc/confvars +++ /dev/null @@ -1,5 +0,0 @@ -# This file is used by bfenv and bfrun (bash scripts) -borg_init_opts=( -e repokey-blake2 --make-parent-dirs -v ) -borg_check_opts=( --last $((1+$(bfwhat | wc -l) )) -v ) -borg_create_opts=( --one-file-system --compression zstd --exclude-caches --exclude-if-present=NOBACKUPDIR.TAG --keep-exclude-tags --list --filter=AMEi-x --stats --show-rc -v ) -quiet=0 diff --git a/borg-family-0.1/src/etc/excludes.d/home b/borg-family-0.1/src/etc/excludes.d/home deleted file mode 100644 index c7aead3..0000000 --- a/borg-family-0.1/src/etc/excludes.d/home +++ /dev/null @@ -1,4 +0,0 @@ -**/.cache/* -/home/*/.mozilla/**/datareporting -/home/*/.thunderbird/**/global-messages-db.sqlite -/home/*/.thunderbird/**/ImapMail diff --git a/borg-family-0.1/src/etc/excludes.d/rootfs b/borg-family-0.1/src/etc/excludes.d/rootfs deleted file mode 100644 index b61797b..0000000 --- a/borg-family-0.1/src/etc/excludes.d/rootfs +++ /dev/null @@ -1,5 +0,0 @@ -/rootfs/var/cache/apt/* -**/.cache/* -/rootfs/home/*/.mozilla/**/datareporting -/rootfs/home/*/.thunderbird/**/global-messages-db.sqlite -/rootfs/home/*/.thunderbird/**/ImapMail diff --git a/borg-family-0.1/src/sbin/bfenv b/borg-family-0.1/src/sbin/bfenv deleted file mode 100755 index 756ef62..0000000 --- a/borg-family-0.1/src/sbin/bfenv +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/bash -umask 0077 -source /etc/borg-family/confvars -source /etc/borg-family/envvars -PATH="/etc/borg-family:$PATH" - -if [ \! -r /etc/borg-family/passphrase ]; then - echo "No passphrase (repokey) found, creating a new one" >&2 - touch /etc/borg-family/passphrase - chmod 600 /etc/borg-family/passphrase - pwgen 32 1 >> /etc/borg-family/passphrase - ls -l /etc/borg-family/passphrase >&2 - echo "You NEED to store it in a password manager to be able to restore backups" >&2 -fi - -if [ \! -r /etc/borg-family/id_rsa_borg ]; then - echo "No SSH key found, creating a new one" >&2 - ssh-keygen -N "" -C "$(id -un)_borg@$(hostname)" -f /etc/borg-family/id_rsa_borg \ - && cat /etc/borg-family/id_rsa_borg.pub -fi - -borg init "${borg_init_opts[@]}" 2>&1 | grep -vE '^A repository already exists' >&2 - -if ! borg check "${borg_check_opts[@]}"; then - echo "Showing BORG_* env variables (see /etc/borg-family/envvars) :" >&2 - env | grep ^BORG_ >&2 - echo "End of BORG_* env variables" >&2 - echo >&2 - echo "Can't access to or check the borg repository, exiting, no backup made" >&2 - exit 1 -fi diff --git a/borg-family-0.1/src/sbin/bfrun b/borg-family-0.1/src/sbin/bfrun deleted file mode 100755 index c02187a..0000000 --- a/borg-family-0.1/src/sbin/bfrun +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/bash -source bfenv -bfwhat | while IFS=' ' read -r mpe dev; do - mp=$(echo -e "$mpe") # mp: interpret escapings that may be present in /proc/mounts (\040 for space...) - name=${mp// /_}; # name: replace space by underscore - name=${mp//\//-}; name=${name/-/} # name: replace slash by dash, remove the leading one - if [[ "$mp $name $dev" =~ "--" || "$mp $name $dev" =~ ".." || "$mp $name $dev" =~ "[|&;()<>]" ]]; then - echo "Skipping $mpe because of shell unsafe characters" >&2 - continue - fi - - comment=$(blkid -- "$dev") - if [ -r "/etc/borg-family/excludes.d/$name" ]; then - runtime_args=( --comment="$comment" --exclude-from="/etc/borg-family/excludes.d/$name" ) - else - runtime_args=( --comment="$comment" ) - fi - - bfhooks before "$name" && \ - borg create "${runtime_args[@]}" "${borg_create_opts[@]}" "::{hostname}-$name-{now:%Y-%m-%d}" "$mp" - rc1=$? - bfhooks after "$name" - rc2=$? - if [ "$rc1" -ne 0 -o "$rc2" -ne 0 ]; then - echo "Errors during $name backup, return codes $rc1 (bfhook before && borg create) and $rc2 (bfhook after)" >&2 - else - [ "x$quiet" == "x1" ] || echo "Success for $name backup" - fi -done diff --git a/borg-family-0.1/src/sbin/bfwhat b/borg-family-0.1/src/sbin/bfwhat deleted file mode 100755 index bf9cf4d..0000000 --- a/borg-family-0.1/src/sbin/bfwhat +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/bash -what-from-proc-mounts() { - # Special case for "/", show it as /rootfs (see hook_* files). Helps saving initial /dev nodes files behind udev - awk '( $2 == "/" ) { print "/rootfs",$1 }' /proc/mounts - - # Backup all non "/", non-removable, mounted filesystems which device is also shown in /sys/block - tmp=$(mktemp) - grep 0 /sys/block/*/removable | sed -e 's#^/sys/block#^/dev#' -e 's#/removable:0$##' >> "$tmp" - grep -Ef "$tmp" /proc/mounts | awk '( $2 !~ /^\/(rootfs|$)/ ) { print $2,$1 }' - rm -- "$tmp" -} - -if [ -r /etc/borg-family/what.override ]; then - cat /etc/borg-family/what.override -else - if [ -r /etc/borg-family/what.include ]; then - cat /etc/borg-family/what.include - fi - if [ -r /etc/borg-family/what.exclude ]; then - what-from-proc-mounts | grep -vEf /etc/borg-family/what.exclude - else - what-from-proc-mounts - fi -fi -- cgit v1.2.3