summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Mekkering2017-10-03 18:04:25 +0200
committerAlex Mekkering2017-10-03 18:04:25 +0200
commit8e4cd3516a8ad92bbab6b0c7a8414cd39f5f6a6c (patch)
tree9d7a2ca5f5b046abef58ff03fb6469c577a66132
parent7ac0902918ede7c7f9eb415b2b0a6fe9dc2c2627 (diff)
downloadaur-8e4cd3516a8ad92bbab6b0c7a8414cd39f5f6a6c.tar.gz
Keep unlimited yearly archives and switch to GitHub
-rw-r--r--.SRCINFO13
-rw-r--r--PKGBUILD29
-rwxr-xr-xluky-borg-backup76
-rw-r--r--luky-borg-backup.conf26
-rw-r--r--luky-borg-backup.service8
-rw-r--r--luky-borg-backup.timer10
6 files changed, 16 insertions, 146 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 79d1c84c6b6..3e581452661 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,21 +1,16 @@
pkgbase = luky-borg-backup
pkgdesc = Automated backup scripts using Borg Backup, systemd and optionally Nextcloud/ownCloud/Stack
- pkgver = 1.0.1
+ pkgver = 1.0.2
pkgrel = 1
+ url = https://github.com/AlexMekkering/luky-borg-backup
arch = any
license = GPL3
depends = borg
optdepends = owncloud-client: For backing up to Nextcloud/ownCloud/Stack
optdepends = systemd-unit-status-mail: For mailing the backup unit's status
backup = etc/luky-borg-backup.conf
- source = luky-borg-backup
- source = luky-borg-backup.service
- source = luky-borg-backup.timer
- source = luky-borg-backup.conf
- sha256sums = 4410d6f2938d47373f2877f08421ceb69faf302782056cf1c7dcb2290d8c606e
- sha256sums = 5ba04f45d567a60d8eb8cc6cd57b9974635e0bed84882d6d7b272d955140dcca
- sha256sums = 188463a3644df0e70e030d0236b6ef04446cd5064a50a7307f1792c3645e31bd
- sha256sums = 7245e87ab2516d808158dab177c07247e2c61d5d8c41d61cac4143182c1a6a58
+ source = https://github.com/AlexMekkering/luky-borg-backup/archive/v1.0.2.tar.gz
+ sha256sums = eefdb668ee4fa08f94fca9bcc2227c2a9e3b518dcb735bf2c25d7af66cf293ed
pkgname = luky-borg-backup
diff --git a/PKGBUILD b/PKGBUILD
index 230a9143d9e..8cacfb1ae3e 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -2,28 +2,23 @@
pkgname=luky-borg-backup
-pkgver=1.0.1
+pkgver=1.0.2
pkgrel=1
pkgdesc="Automated backup scripts using Borg Backup, systemd and optionally Nextcloud/ownCloud/Stack"
arch=(any)
-license=('GPL3')
-depends=('borg')
+license=("GPL3")
+url="https://github.com/AlexMekkering/luky-borg-backup"
+depends=("borg")
optdepends=("owncloud-client: For backing up to Nextcloud/ownCloud/Stack"
"systemd-unit-status-mail: For mailing the backup unit's status")
-source=('luky-borg-backup'
- 'luky-borg-backup.service'
- 'luky-borg-backup.timer'
- 'luky-borg-backup.conf'
-)
-backup=('etc/luky-borg-backup.conf')
-sha256sums=('4410d6f2938d47373f2877f08421ceb69faf302782056cf1c7dcb2290d8c606e'
- '5ba04f45d567a60d8eb8cc6cd57b9974635e0bed84882d6d7b272d955140dcca'
- '188463a3644df0e70e030d0236b6ef04446cd5064a50a7307f1792c3645e31bd'
- '7245e87ab2516d808158dab177c07247e2c61d5d8c41d61cac4143182c1a6a58')
+source=("https://github.com/AlexMekkering/luky-borg-backup/archive/v${pkgver}.tar.gz")
+backup=("etc/luky-borg-backup.conf")
+sha256sums=('eefdb668ee4fa08f94fca9bcc2227c2a9e3b518dcb735bf2c25d7af66cf293ed')
package() {
- install -D -m 755 "$srcdir/luky-borg-backup" "$pkgdir/usr/bin/luky-borg-backup"
- install -D -m 644 "$srcdir/luky-borg-backup.service" "$pkgdir/usr/lib/systemd/system/luky-borg-backup.service"
- install -D -m 644 "$srcdir/luky-borg-backup.timer" "$pkgdir/usr/lib/systemd/system/luky-borg-backup.timer"
- install -D -m 600 "$srcdir/luky-borg-backup.conf" "$pkgdir/etc/luky-borg-backup.conf"
+ cd ${srcdir}/${pkgname}-${pkgver}
+ install -D -m 755 "luky-borg-backup" "$pkgdir/usr/bin/luky-borg-backup"
+ install -D -m 644 "luky-borg-backup.service" "$pkgdir/usr/lib/systemd/system/luky-borg-backup.service"
+ install -D -m 644 "luky-borg-backup.timer" "$pkgdir/usr/lib/systemd/system/luky-borg-backup.timer"
+ install -D -m 600 "luky-borg-backup.conf" "$pkgdir/etc/luky-borg-backup.conf"
}
diff --git a/luky-borg-backup b/luky-borg-backup
deleted file mode 100755
index bb63eb5312e..00000000000
--- a/luky-borg-backup
+++ /dev/null
@@ -1,76 +0,0 @@
-#!/bin/sh
-CONFFILE=/etc/luky-borg-backup.conf
-. $CONFFILE
-
-if [ -z "$REPOSITORY" ]; then
- echo "ERROR: No REPOSITORY set. Please edit $CONFFILE"
- exit
-fi
-
-# Try to mount the MOUNTPOINT first (if one exists)
-premounted="1" # assume all mounts were already in place before we started
-mounted="1" # assume a mounted state until proven otherwise
-if [ ! -z "$MOUNTPOINT" ]; then
- premounted="0"
- mounted="0"
-
- if [ `mount | grep -c "$MOUNTPOINT"` -ne "0" ]; then
- premounted="1"
- mounted="1"
- echo "$MOUNTPOINT was already mounted..."
- else
- echo "Mounting $MOUNTPOINT..."
- mount "$MOUNTPOINT"
- if [ "$?" -ne "0" ]; then
- echo "ERROR: $MOUNTPOINT could not be mounted!"
- else
- echo " Mounted $MOUNTPOINT!"
- mounted="1"
- fi
- fi
-fi
-
-if [ "$mounted" -eq "1" ]; then
- # Backup all necessary files and directories using deduplication and lz4 conpression
-
- echo
- echo "Backing up to $REPOSITORY..."
- borg create -v -s --noatime -C lz4 $REPOSITORY::'{hostname}-{now:%Y-%m-%dT%H:%M:%S.%f}' $SOURCES
- echo " Backed up to $REPOSITORY!"
- echo
-
- # Use the `prune` subcommand to maintain 7 daily, 4 weekly and 6 monthly
- # archives of THIS machine. The '{hostname}-' prefix is very important to
- # limit prune's operation to this machine's archives and not apply to
- # other machine's archives also.
- borg prune -v --list $REPOSITORY --prefix '{hostname}-' --keep-daily=7 --keep-weekly=4 --keep-monthly=12
-
- if [ ! -z "$CLOUDFOLDER" ]; then
- echo
- echo "Syncing $REPOSITORY with $CLOUDFOLDER..."
- owncloudcmd -u $CLOUDUSER -s -p $CLOUDPASSWORD -h $REPOSITORY $CLOUDFOLDER
- echo " Synced $REPOSITORY with $CLOUDFOLDER!"
- fi
-
- if [ ! -z "$MOUNTPOINT" ]; then
- echo
- echo "=============================================="
- echo "Usage of filesystem at $MOUNTPOINT after backing up:"
- echo "----------------------------------------------"
- df -hT ${MOUNTPOINT}
- echo "=============================================="
- echo
-
- if [ "$premounted" -eq "0" ]; then
- echo "Unmounting $MOUNTPOINT..."
- umount "$MOUNTPOINT"
- if [ "$?" -eq "0" ]; then
- echo " Unmounted $MOUNTPOINT"
- else
- echo "ERROR: $MOUNTPOINT could not be unmountedi!"
- fi
- else
- echo "Keeping $MOUNTPOINT mounted because it was already mounted!"
- fi
- fi
-fi
diff --git a/luky-borg-backup.conf b/luky-borg-backup.conf
deleted file mode 100644
index 1341affd89c..00000000000
--- a/luky-borg-backup.conf
+++ /dev/null
@@ -1,26 +0,0 @@
-# Optionally, set a MOUNTPOINT to mount at start and unmount at finish
-# (if it wasn't mounted already at start). i.e.:
-# MOUNTPOINT=/mnt
-
-# Optionally set the Stack (or Owncloud or Nextcloud) folder to sync backups to. i.e.:
-# CLOUDFOLDER="https://transip.stackstorage.com/remote.php/webdav/backup"
-
-# Optionally set a username and password for Stack (or Owncloud or Nextcloud). i.e.:
-# CLOUDUSER="admin"
-# CLOUDPASSWORD="password"
-
-# Optionally export the BORG_PASSPHRASE to be able to non-interactively create an encrypted backup (Recommended). i.e.:
-# export BORG_PASSPHRASE='secret'
-
-# Optionally, export other BORG Environment Variables. i.e.:
-# export BORG_RELOCATED_REPO_ACCESS_IS_OK=yes # non-interactively accept relocation of a repository
-
-# Set the borg REPOSITORY to backup to. i.e.:
-# REPOSITORY="$MOUNTPOINT/backup"
-
-# Define the folders/files to include/exclude. i.e.:
-# SOURCES="\
-# /etc \
-# /srv/http \
-# -e /etc/mtab \
-# "
diff --git a/luky-borg-backup.service b/luky-borg-backup.service
deleted file mode 100644
index 98a16cdcc41..00000000000
--- a/luky-borg-backup.service
+++ /dev/null
@@ -1,8 +0,0 @@
-[Unit]
-Description=LukyLX Incremental Backup
-Wants=unit-status-mail@%n.service
-Before=unit-status-mail@%n.service
-
-[Service]
-Type=oneshot
-ExecStart=/usr/bin/luky-borg-backup
diff --git a/luky-borg-backup.timer b/luky-borg-backup.timer
deleted file mode 100644
index 6785083387a..00000000000
--- a/luky-borg-backup.timer
+++ /dev/null
@@ -1,10 +0,0 @@
-[Unit]
-Description=Run luky-borg-backup every night
-
-[Timer]
-OnCalendar=04:00
-AccuracySec=1h
-Persistent=yes
-
-[Install]
-WantedBy=timers.target