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