From 63b0cd2c634e5099e05a6d9843f2cc3c3b6513b7 Mon Sep 17 00:00:00 2001 From: Tharre Date: Sat, 9 Feb 2019 16:28:37 +0100 Subject: arch-system: borgbackup: use snapshot timestamps Previously, a archive would get the timestamp of the time it was uploaded, instead of the time when the snapshot was created. This is problematic, since archives are pruned by this timestamp, meaning if multiple archives are uploaded together most of them would be pruned immediately after. --- arch-system/PKGBUILD | 4 ++-- arch-system/backup-sudo | 1 + arch-system/borgbackup | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/arch-system/PKGBUILD b/arch-system/PKGBUILD index 5e318ac..1f47597 100644 --- a/arch-system/PKGBUILD +++ b/arch-system/PKGBUILD @@ -29,10 +29,10 @@ sha256sums=('bb00c42f2802c12536c46700b948d41a43153d97a6986827b7c61203880e1ad1' '7467bb40e7d404ed249b34a0e410b8d452ebc4b90588d7e210bfa47011b5981d' 'dd84877b7f6f4330da489fa33f843c9a7c862562a3d78dc2feea5116ac846a79' '483a7d9350653c2cf22f36f67f1a83cc5c95232dfc10642a20d76e3c32c9e2e3' - '99cd268de0e9b847d65f802e7bcbbf7318398a04db61523545d4002ebdfb4d9c' + 'ea50cd57140fc3a27c027de7c289f058c23c840cc9ce65593969e8e2dd5b8e65' '42050ba722df1cd606288e82054e131dac99bf10506f4c8d52eb9bfc0a078d89' 'e1bf3dc5978a7641f86975b7ee770a6914b30a8e4b7e3be2f1b07eaa7098591d' - 'e5eb8baf5e3f132a0a4e2257261872356075896e0a419fe2c03b608063279994' + 'e1e862b4be6aa666bd1ca2ddd01eb5e57e063d1a2d23b60666ae6006be9ad929' '5613c98d32e513a973e8a0e250ab0b267882a73615f507b6208d4a5f21487fe6') package_base-system() { diff --git a/arch-system/backup-sudo b/arch-system/backup-sudo index b2694b6..38594da 100755 --- a/arch-system/backup-sudo +++ b/arch-system/backup-sudo @@ -12,6 +12,7 @@ validate_path() { case "$1" in snapshot) validate_path "$2" + touch /home btrfs subvolume snapshot -r -- /home "$2" ;; delete_snapshot) diff --git a/arch-system/borgbackup b/arch-system/borgbackup index a022b3d..9368452 100755 --- a/arch-system/borgbackup +++ b/arch-system/borgbackup @@ -49,6 +49,7 @@ backup() { cd /backup borg create --stats $borg_progress \ --exclude-from ~/.borg_exclude \ + --timestamp . \ --show-rc \ ::"$(basename "$1")" . && rc=$? || rc=$? if [ $rc -eq 1 ]; then -- cgit v1.2.3-70-g09d2