# pull in beets library locally
beetpull() {
- local sshfs_host
+ local sshfs_host sshfs_cmd
sshfs_host=b8.nz
if [[ $HOSTNAME == kd ]]; then
return 0
s mkdir /i
s chown iank:iank /i
fi
- if ! mountpoint /i &>/dev/null; then
- m sshfs $sshfs_host:/i /i
+ sshfs_cmd="sshfs -o ServerAliveInterval=15,reconnect $sshfs_host:/i /i"
+ if ! pgrep -f "^$sshfs_cmd$" >/dev/null; then
+ m $sshfs_cmd
fi
}
else
i=0
fi
- min_date=$(date -d 'monday 2 weeks ago' +%s)
+ # usually do this on monday, sometimes later
+ if [[ $(date +%A) == Monday ]]; then
+ min_date=$(date -d 'monday 2 weeks ago' +%s)
+ else
+ min_date=$(date -d 'monday 3 weeks ago' +%s)
+ fi
for (( ; i < logcount; i++ )); do
log=${logs[$i]}
d=$(date -d "$(head -n1 $log|awk '{print $1}')" +%s)
popd
}
-# tail pms in the last day, for the case where we restart profanity and
-# didn't check for pms beforehand.
-profrecent() {
+# Tail pms in the last day, for the case where we restart profanity and
+# didn't check for pms beforehand. Assume the most recent logs are on kd.
+# If that isn't the case, use prof-recent-local
+prof-recent() {
+ case $HOSTNAME in
+ kd)
+ prof-recent-local
+ ;;
+ *)
+ ssh b8.nz prof-recent-local
+ ;;
+ esac
+}
+
+prof-recent-local() {
local d dates date files f
# consider making the day count passed by parameter. note: this works: $(date -d '2 day ago' +%Y_%m_%d)
- dates=("$(date -d +%Y_%m_%d)" "$(date -d '1 day ago' +%Y_%m_%d)" )
+ dates=("$(date +%Y_%m_%d)" "$(date -d '1 day ago' +%Y_%m_%d)" )
for d in /d/p/profanity/chatlogs/iank_at_fsf.org/!(rooms); do
files=()
for date in ${dates[@]}; do