Commit 39445c5

xxwhirlpool  ·  2026-07-04 13:11:32 -0400 EDT
parent 9b8579d
add my jank script to back up personal IRC logs
1 files changed,  +30, -0
+30, -0
 1@@ -0,0 +1,30 @@
 2+#!/usr/bin/env bash
 3+#
 4+# get IRC logs from my network, back them up, & import
 5+# into personal DB for safekeeping
 6+
 7+# vars for file names/paths
 8+irchistpath="$HOME/.irc_history/logs"
 9+irchistbasepath="$HOME/.irc_history"
10+irctargz="irc_history.tar.gz"
11+
12+# get logs only if `pass` is available to give soju pw
13+# otherwise die
14+if [[ "$(command -v pass)" ]]; then
15+	pass show "social/soju" | chathistorysync kat@chat.4-walls.net "$irchistpath"
16+else
17+	echo "chat sync failed" && exit 1
18+fi
19+
20+# add dates next to timestamps in logs without them
21+perl "$irchistpath/dates2logs.pl"
22+
23+# zip up the logs
24+tar -C "$irchistpath" -czvf "$irchistbasepath/$irctargz" .
25+
26+# copy the archive to server
27+rsync -avzp "$irctargz" kat@athena:/home/kat/backups
28+
29+# SSH into athena machine & run import script
30+# this updates the local LAN only DB
31+ssh athena "cd catirc && ./import_logs.sh"