summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc Vertes <mvertes@free.fr>2020-06-09 10:06:11 +0200
committerMarc Vertes <mvertes@free.fr>2020-06-09 10:06:11 +0200
commitbc43abee15ba8634fba1d279a3c8378111501960 (patch)
tree61123ac2faa81bd7ebb0f9291dba79ad23da907a
parentd753d0f7cf3036e8e333bc6d806c90b4883bfcbf (diff)
update
-rwxr-xr-xbin/backup13
-rwxr-xr-xbin/bgc2
-rwxr-xr-xbin/gauth2
-rwxr-xr-xbin/yoda2
4 files changed, 14 insertions, 5 deletions
diff --git a/bin/backup b/bin/backup
index 2ee6b83..cc98d63 100755
--- a/bin/backup
+++ b/bin/backup
@@ -6,7 +6,16 @@ die() { echo "$0: fatal: $@" >&2; exit 1; }
[ "$(id -u)" = 0 ] || die must run as root
-dest=${1:-bip:/home/backup}/$(hostname)
+while getopts :v opt; do
+ case $opt in
+ (v) optv=v ;;
+ (*) echo "Usage: $0 [-v] [[host:]dir]"; exit 1 ;;
+ esac
+done
+shift $((OPTIND - 1))
+
+#dest=${1:-/backup/$(hostname)}
+dest=${1:-/.history}
date=$(date +%Y%m%d_%H%M%S)
last=$(rsync --list-only $dest/ 2>/dev/null | cut -b 47- | tail -1)
@@ -15,4 +24,4 @@ case $last in
(*) opt_link=;;
esac
-rsync -DSHxav --exclude-from=/etc/backup/ignore $opt_link / /boot /home $dest/$date
+rsync -DSHxa$optv --exclude-from=/etc/backup/ignore $opt_link / /boot $dest/$date
diff --git a/bin/bgc b/bin/bgc
index 6ff6874..514b9ab 100755
--- a/bin/bgc
+++ b/bin/bgc
@@ -46,7 +46,7 @@ retention_delay() {
}
# sorted list of backups, most recent first
-lbu=$(ssh bip ls /home/backup/swift | sort -r)
+lbu=$(ssh bip ls -rv /home/backup/swift)
for d in $lbu; do
tsc=$(date2ts $d)
if ! [ "$tsp" ]; then
diff --git a/bin/gauth b/bin/gauth
index 6c00e1e..575d6fc 100755
--- a/bin/gauth
+++ b/bin/gauth
@@ -1,7 +1,7 @@
#!/bin/sh
# Use backup from andOTP
-gpg -qd ~/otp_accounts.json.gpg |
+gpg -qd ~/.otp_accounts.json.gpg |
jq -r '.[] | "\(.label) \(.secret)"' |
while read -r l s; do
echo "$l $(oathtool --totp -b "$s")"
diff --git a/bin/yoda b/bin/yoda
index 4aa1667..4a2e0f9 100755
--- a/bin/yoda
+++ b/bin/yoda
@@ -1,7 +1,7 @@
#!/bin/sh
# Setup an archlinux system to a media
-version='yoda-0.1'
+version='yoda-0.2'
help() {
echo 'usage: yoda [-CV] [-u user] dev