xxwhirlpool
·
2026-07-04
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"
9irctargz="irc_history.tar.gz"
10
11# get logs only if `pass` is available to give soju pw
12# otherwise die
13if [[ "$(command -v pass)" ]]; then
14 pass show "social/soju" | chathistorysync kat@chat.4-walls.net "$irchistpath"
15else
16 echo "chat sync failed" && exit 1
17fi
18
19# add dates next to timestamps in logs without them
20perl "$irchistpath/dates2logs.pl"
21
22# zip up the logs
23tar -C "$irchistpath" -czvf "$irchistbasepath/$irctargz" .
24
25# copy the archive to server
26rsync -avzp "$irctargz" kat@athena:/home/kat/backups
27
28# SSH into athena machine & run import script
29# this updates the local LAN only DB
30ssh athena "cd catirc && ./import_logs.sh"