summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc Vertes <mvertes@free.fr>2021-12-07 14:50:57 +0100
committerMarc Vertes <mvertes@free.fr>2021-12-07 14:50:57 +0100
commit4233fc9c6bc0f2f136a495efcd497394edd5156b (patch)
tree6afd66983309ec9385b43deab5273ae211766564
parent14b5c600034a9d52497af2974f30dafc21710282 (diff)
update
-rw-r--r--.backupignore5
-rwxr-xr-xbin/backup3
-rwxr-xr-xbin/backup-clean4
3 files changed, 8 insertions, 4 deletions
diff --git a/.backupignore b/.backupignore
index a660b53..3834dfa 100644
--- a/.backupignore
+++ b/.backupignore
@@ -13,7 +13,12 @@ go/pkg
*.socket
*.db-wal
*.db-shm
+*.old
+*.log
+*.o
*- Google Drive
+build/*/
+login.keychain-db
httpstorages.*
SiriAnalytics.db
Application Support/Knowledge/
diff --git a/bin/backup b/bin/backup
index 3964927..d682849 100755
--- a/bin/backup
+++ b/bin/backup
@@ -42,6 +42,5 @@ esac
date=$(date +%Y-%m-%d-%H%M%S)
-[ "$optv" ] && echo "# Backup $volumes to $BACKUP/$date"
-
+echo "# Backup $volumes to $BACKUP/$date"
exec rsync -HSxa$optv $ignore $opt_link $volumes "$BACKUP/$date"
diff --git a/bin/backup-clean b/bin/backup-clean
index f5baa29..34e6d97 100755
--- a/bin/backup-clean
+++ b/bin/backup-clean
@@ -33,7 +33,7 @@ host=${BACKUP%:*} dir=${BACKUP#*:}
ls='ls -r' rm="xargs -r $optv $optn rm -rf"
[ "$host" = "$dir" ] || ls="ssh $host $ls" rm="ssh $host $rm"
-[ "$optv" ] && echo "# Cleaning backups on $BACKUP"
+echo "# Cleaning backups on $BACKUP"
$ls "$dir" |
awk -v now=$(date +%Y-%m-%d) -v dir="$dir" '
@@ -51,7 +51,7 @@ BEGIN {
dy = yn - yb
dm = dy * 12 + mn - mb
# if (yb != yn) {
- if (dm > 12)
+ if (dm > 12) {
if (yb in yearly) print; else yearly[yb] = 1
next
}