aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/archive.sh13
-rwxr-xr-xscripts/backup.sh27
-rwxr-xr-xscripts/wget-4.sh2
3 files changed, 34 insertions, 8 deletions
diff --git a/scripts/archive.sh b/scripts/archive.sh
new file mode 100755
index 0000000..416b833
--- /dev/null
+++ b/scripts/archive.sh
@@ -0,0 +1,13 @@
+#!/usr/bin/env bash
+set -euo pipefail
+cd "$(dirname "${BASH_SOURCE[0]}")"
+
+export POCKET_ARCHIVE='https://getpocket.com/users/euandreh/feed/read'
+export OUTPUT_DIR="$HOME/archive/archivebox/"
+export WGET_BINARY="$PWD/wget-4.sh"
+export FETCH_MEDIA=False
+if [ "${1-}" = "-s" ]; then
+ curl -s "$POCKET_ARCHIVE" | archivebox >> /tmp/archivebox.log
+else
+ curl -s "$POCKET_ARCHIVE" | archivebox
+fi
diff --git a/scripts/backup.sh b/scripts/backup.sh
index f31a503..b13108f 100755
--- a/scripts/backup.sh
+++ b/scripts/backup.sh
@@ -6,16 +6,21 @@
#
if [ ! -d ~/UTCLOUD/ ]; then
- red "$HOME/UTCLOUD not attached. Backup not started."
- exit 1
+ red "$HOME/UTCLOUD not attached. Backup not started."
+ exit 1
+fi
+
+if [ ! -d ~/archive/ ]; then
+ yellow "$HOME/archive/ folder doesn't exist. Downloading latest version from ~/UTCLOUD/archive/ into ~/archive/."
+ rsync --verbose --progress --stats --update --recursive ~/UTCLOUD/archive/ ~/archive
fi
if [ ! -d ~/borgbackup/ ]; then
- yellow "$HOME/borgbackup/ repository doesn't exist. Downloading latest version from ~/UTCLOUD/borg/borgbackup/ into ~/borgbackup/"
- # The initial borg repo was created with:
- # $ borg init --append-only --encryption=keyfile ~/borgbackup
- # See also: https://borgbackup.readthedocs.io/en/stable/usage/notes.html#append-only-mode
- rsync --verbose --progress --stats --update --recursive ~/UTCLOUD/borg/borgbackup/ ~/borgbackup
+ yellow "$HOME/borgbackup/ repository doesn't exist. Downloading latest version from ~/UTCLOUD/borg/borgbackup/ into ~/borgbackup/."
+ # The initial borg repo was created with:
+ # $ borg init --append-only --encryption=keyfile ~/borgbackup
+ # See also: https://borgbackup.readthedocs.io/en/stable/usage/notes.html#append-only-mode
+ rsync --verbose --progress --stats --update --recursive ~/UTCLOUD/borg/borgbackup/ ~/borgbackup
fi
BACKUP_TAG="${1-default}"
@@ -28,10 +33,16 @@ borg create \
--compression lzma,6 \
~/borgbackup::"{hostname}-{now}-${BACKUP_TAG}" \
~/ownCloud/ \
- ~/mbsync/
+ ~/Nextcloud/ \
+ ~/mbsync/ \
+ ~/archive/
# add folders to be backed up here
green "Done"
+yellow "Syncing ~/archive to ~/UTCLOUD/archive"
+rsync --verbose --progress --stats --update --recursive ~/archive/ ~/UTCLOUD/archive/
+green "Done"
+
yellow "Syncing ~/borgbackup to ~/UTCLOUD/borg/borgbackup/"
rsync --verbose --progress --stats --update --recursive ~/borgbackup/ ~/UTCLOUD/borg/borgbackup/
green "Done"
diff --git a/scripts/wget-4.sh b/scripts/wget-4.sh
new file mode 100755
index 0000000..1066441
--- /dev/null
+++ b/scripts/wget-4.sh
@@ -0,0 +1,2 @@
+#!/usr/bin/env bash
+wget -4 "$@"