sad
)
-
-for g in ${ignore_genres[@]}; do
- ignore_genres_a[$g]=t
-done
-for g in ${slow_genres[@]}; do
- slow_genres_a[$g]=t
-done
-
-# genres that have a beat
-beat_genres=()
-genres=()
-
-
-# relatively upbeat genres to listen, eg while biking
-upbeat_genres=()
-for g in ${all_genres[@]}; do
- if [[ ${ignore_genres_a[$g]} ]]; then continue; fi
- genres+=($g)
- if [[ ${slow_genres_a[$g]} ]]; then continue; fi
- beat_genres+=($g)
- case $g in
- chill)
- continue
- ;;
- esac
- upbeat_genres+=($g)
-done
-
-# generate regex for beat playlist
-beat_regex=
-first=true
-for g in ${beat_genres[@]}; do
- if $first; then
- first=false
- beat_regex=$g
- else
- beat_regex+="|$g"
- fi
-done
-
-# generate regex for upbeat playlist
-upbeat_regex=
-first=true
-for g in ${upbeat_genres[@]}; do
- if $first; then
- first=false
- upbeat_regex=$g
- else
- upbeat_regex+="|$g"
- fi
-done
-
declare -A bpla # beet playlist associative array
beetapl() { # beet add playlist
local name
bpla[$name]="${@@Q}"
}
-for g in ${genres[@]}; do
- for r in {3..5}; do
+
+# this function is just so we can have some local vars
+# and not mess with the global var namespace.
+_beet-gen-global-vars() {
+
+ local first g t r
+
+ for g in ${ignore_genres[@]}; do
+ ignore_genres_a[$g]=t
+ done
+ for g in ${slow_genres[@]}; do
+ slow_genres_a[$g]=t
+ done
+
+ # genres that have a beat
+ beat_genres=()
+ genres=()
+
+
+ # relatively upbeat genres to listen, eg while biking
+ upbeat_genres=()
+ for g in ${all_genres[@]}; do
+ if [[ ${ignore_genres_a[$g]} ]]; then continue; fi
+ genres+=($g)
+ if [[ ${slow_genres_a[$g]} ]]; then continue; fi
+ beat_genres+=($g)
case $g in
- pop|rap)
- beetapl ${g}-${r} rating:${r}..5 genre::^$g\$ ^expl:t ^gimicky:t ^lesser_version:t
- beetapl ${g}-x-${r} rating:${r}..5 genre::^$g\$ ^gimicky:t ^lesser_version:t
- ;;
- *)
- beetapl ${g}-${r} rating:${r}..5 genre:$g ^gimicky:t ^lesser_version:t
+ chill)
+ continue
;;
esac
+ upbeat_genres+=($g)
+ done
+
+ # generate regex for beat playlist
+ beat_regex=
+ first=true
+ for g in ${beat_genres[@]}; do
+ if $first; then
+ first=false
+ beat_regex=$g
+ else
+ beat_regex+="|$g"
+ fi
+ done
+
+ # generate regex for upbeat playlist
+ upbeat_regex=
+ first=true
+ for g in ${upbeat_genres[@]}; do
+ if $first; then
+ first=false
+ upbeat_regex=$g
+ else
+ upbeat_regex+="|$g"
+ fi
+ done
+
+
+ for g in ${genres[@]}; do
+ for r in {3..5}; do
+ case $g in
+ pop|rap)
+ beetapl ${g}-${r} rating:${r}..5 genre::^$g\$ ^expl:t ^gimicky:t ^lesser_version:t
+ beetapl ${g}-x-${r} rating:${r}..5 genre::^$g\$ ^gimicky:t ^lesser_version:t
+ ;;
+ *)
+ beetapl ${g}-${r} rating:${r}..5 genre:$g ^gimicky:t ^lesser_version:t
+ ;;
+ esac
+ done
+ done
+
+ for t in ${tags[@]}; do
+ for r in {3..5}; do
+ beetapl ${t}-${r} rating:${r}..5 $t:t ^lesser_version:t
+ done
done
-done
-for t in ${tags[@]}; do
for r in {3..5}; do
- beetapl ${t}-${r} rating:${r}..5 $t:t ^lesser_version:t
+ beetapl beat-${r} rating:${r}..5 genre::$beat_regex ^expl:t ^gimicky:t ^lesser_version:t
+ beetapl beat-x-${r} rating:${r}..5 genre::$beat_regex ^gimicky:t ^lesser_version:t
+ beetapl upbeat-${r} rating:${r}..5 genre::$upbeat_regex ^expl:t ^gimicky:t ^lesser_version:t ^sad:t
+ beetapl upbeat-x-${r} rating:${r}..5 genre::$upbeat_regex ^gimicky:t ^lesser_version:t ^sad:t
+ beetapl gimicky-${r} rating:${r}..5 gimicky:t ^lesser_version:t
done
-done
-
-for r in {3..5}; do
- beetapl beat-${r} rating:${r}..5 genre::$beat_regex ^expl:t ^gimicky:t ^lesser_version:t
- beetapl beat-x-${r} rating:${r}..5 genre::$beat_regex ^gimicky:t ^lesser_version:t
- beetapl upbeat-${r} rating:${r}..5 genre::$upbeat_regex ^expl:t ^gimicky:t ^lesser_version:t ^sad:t
- beetapl upbeat-x-${r} rating:${r}..5 genre::$upbeat_regex ^gimicky:t ^lesser_version:t ^sad:t
- beetapl gimicky-${r} rating:${r}..5 gimicky:t ^lesser_version:t
-done
-
-for r in {3..5}; do
- beetapl \
- sy$r rating:${r}..5 genre::$upbeat_regex ^gimicky:t ^lesser_version:t 'artist:sonic youth'
-done
-
-for t in ${nav_tags[@]}; do
- beetapl $t $t:t
-done
+
+ for r in {3..5}; do
+ beetapl \
+ sy$r rating:${r}..5 genre::$upbeat_regex ^gimicky:t ^lesser_version:t 'artist:sonic youth'
+ done
+
+ for t in ${nav_tags[@]}; do
+ beetapl $t $t:t
+ done
+}
+_beet-gen-global-vars
_title_escape="\033]0;"
fi
+ # make the titlebar be the last command and the current directory.
settitle () {
- # this makes it so we show the current command if
- # one is running, otherwise, show nothing
- if [[ $1 == prompt-command ]]; then
+
+ # These are some checks to help ensure we dont set the title at
+ # times that the debug trap is running other than the case we
+ # want. Some of them might not be needed.
+ if (( ${#FUNCNAME[@]} != 1 || ${#BASH_ARGC[@]} != 2 || $BASH_SUBSHELL != 0 )); then
return 0
fi
- if (( ${#BASH_ARGC[@]} == 1 && BASH_SUBSHELL == 0 )); then
- echo -ne "$_title_escape ${PWD/#$HOME/~} "
- printf "%s" "$*"
- echo -ne "\007"
+ if [[ $1 == prompt-command ]]; then
+ return 0
fi
+ echo -ne "$_title_escape ${PWD/#$HOME/~} "
+ printf "%s" "$*"
+ echo -ne "\007"
}
# note, this wont work:
# s sshfs bu@$host:/bu/home/md /bu/mnt -o reconnect,ServerAliveInterval=20,ServerAliveCountMax=30 -o allow_other
eqgo() {
- enn -M "$(exiqgrep -i -r.\*)"
+ local -a array tmpstr
+ tmpstr=$(exiqgrep -i -r.\*)
+ mapfile -t array <<<"$tmpstr"
+ enn -M "${array[@]}"
}
eqgo1() {
enn -M "$(exipick -i -r.\*|h1)"
local last_genre_i fstring tag id char new_item char_i genre tag remove doplay i j random path
local do_rare_genres read_wait help line lsout tmp ls_line skip_lookback
local escape_char escaped_input expected_input skip_input_regex right_pad erasable_line seek_sec
- local pl_state_path pl_state_dir pl_state_file
- local new_random pl_seed_path seed_num seed_file fmt
+ local pl_state_path pl_state_dir pl_state_file tmpstr
+ local new_random pl_seed_path seed_num seed_file fmt first_play
local -a pl_tags buttons button_map ids tags tmp_tags initial_ls ls_lines paths
local -A button_i
local -i i j volume scrolled id_count line_int skip_start pre_j_count head_count skip_lookback
local -i overflow_lines overflow
+ first_play=true
erasable_line=false
escape_char=$(printf "\u1b")
scrolled=999 # more than any $LINES
# PijokVipiotOzeph is just a random string for a delimiter
fmt='%ifdef{rating,$rating }'"$fstring"'$genre | $title - $artist - $album $length $id PijokVipiotOzeph $path'
# shellcheck disable=SC2016 # obvious reason
- mapfile -t initial_ls < <(beet ls -f "$fmt" "$@" | { if $random; then sort -R --random-source=$pl_seed_path; else cat; fi; } )
+ tmpstr=$(beet ls -f "$fmt" "$@" | { if $random; then sort -R --random-source=$pl_seed_path; else cat; fi; } )
+ mapfile -t initial_ls <<<"$tmpstr"
id_count=${#initial_ls[@]}
for line in "${initial_ls[@]}"; do
path="${line#*PijokVipiotOzeph }"
if $doplay; then
#{ mpv --profile=a --volume=$volume --idle 2>&1 & } 2>/dev/null
mpv --profile=a --volume=$volume --idle &
- # if we dont sleep, we get error like this:
+ # if we dont sleep, can expect an error like this:
# socat[1103381] E connect(5, AF=1 "/tmp/mpvsock", 14): Connection refused
- # and strangely, it persists until mpv is restarted.
- # .1 sleep was too little.
- sleep .2
+ sleep .1
fi
while true; do
#{ mpv --profile=a --volume=$volume "$path" 2>&1 & } 2>/dev/null
# old
#{ beet play "--args=--volume=$volume" "id:$id" 2>&1 & } 2>/dev/null
- mpvrpc '{ "command": ["loadfile", "'"$path"'"] }'
+
+ # on slow systems, we may need to wait like .3 seconds before mpv
+ # is ready. so impatiently check until it is ready
+ if $first_play; then
+ first_play=false
+ for (( i=0; i<20; i++ )); do
+ if [[ $(mpvrpco '{ "command": ["get_property", "idle-active"] }' 2>/dev/null | jq .data) == true ]]; then
+ mpvrpc '{ "command": ["loadfile", "'"$path"'"] }' 2>/dev/null
+ break
+ fi
+ sleep .1
+ done
+ else
+ mpvrpc '{ "command": ["loadfile", "'"$path"'"] }'
+ fi
erasable_line=false
fi
while true; do
# Automatically skip to the next song if this one ends, unless
# we turn off the autoplay.
if (( ret == 142 )) || [[ ! $char ]]; then
- if jobs -p | grep -q . &>/dev/null; then
+ if jobs -p | grep -q . &>/dev/null && \
+ [[ $(mpvrpco '{ "command": ["get_property", "idle-active"] }' | jq .data) == false ]]; then
continue
else
break
read -rsn2 escaped_input
skip_input_regex="^[0-9]+$"
case $escaped_input in
- # up char
+ # up char: show all the songs, use less
'[A')
skip_start=0
skip_lookback=5
# tried to use ceb2txt but it failed because of schema
# slightly different than what it expected.
cheogram-get-logs() {
- adb shell rm -r /storage/emulated/0/Download/Cheogram/Backup
+ #adb shell rm -r /storage/emulated/0/Download/Cheogram/Backup
read -r -p "do cheogram backup on phone, do not enable extra cheogram data. press any key when done"
cd /p/cheogram
rm -rf Backup b
mycheologs() {
local days q
days=${1:-16}
- # timezone compared to utc. note: this will need adjustment for spring/fall.
- zone_offset=$(( 60 * 60 * 5 ))
+ # timezone compared to utc. note: this takes the current offset, so if daylight savings change
+ # happened in the looking back period, this won't account for it.
+ zone_offset=$(( $( date +%z | sed 's/[^1-9-]*//g' ) * 60 * 60))
+ case $zone_offset in
+ -*) : ;;
+ *) zone_offset="+ $zone_offset"
+ esac
+ echo zone_offset=$zone_offset
q="
select
- datetime(substr(timeSent,0,11) - $zone_offset, 'unixepoch'),
+ datetime(substr(timeSent,0,11) $zone_offset, 'unixepoch'),
body
from messages
where timeSent > $(( (EPOCHSECONDS - days * 60 * 60 * 24) * 1000 ))
t s w
}
-arbttlog() { arbtt-dump "$@" | grep -v '( )\|Current Desktop' | sed -rn '/^[^ ]/{N;s/^(.{21})([0-9]*)[0-9]{3}m.*\(\*/\1\2/;s/^(.{21})[0-9]*.*\(\*/\1/;s/\n//;p}' ; }
+focus() {
+ /p/c/proc/focus/linux-amd64/focus &
+ watcharb5
+ kill %%
+}
+
+
+watcharb5() {
+ local char ret
+ killall arbtt-capture ||:
+ rm -f ~/.arbtt/capture.log
+ arbtt-capture --sample-rate=10 &
+ clear
+ while true; do
+ arb5
+ ret=0
+ # i first thought to sleep and capture ctrl-c, but it seems we can't
+ # capture control-c, unless maybe we implement the commands in a
+ # separate script or maybe add err-cleanup to err. Anyways, this
+ # method is superior because any single char exits.
+ read -rsN1 -t 5 char || ret=$?
+ if (( ret == 142 )) || [[ ! $char ]]; then
+ # debug
+ #e ret=$ret char=$char
+ :
+ else
+ killall arbtt-capture ||:
+ return 0
+ fi
+ clear
+ done
+
+}
+
+arb5() {
+ local i l sec
+ i=0
+ if [[ ! -e ~/.arbtt/capture.log ]]; then
+ sleep 5
+ fi
+ # https://stackoverflow.com/questions/56486272/how-to-concat-multiple-fields-to-same-line-with-jq
+ arbtt-dump -l 30 -t json | jq -r '.[] | [ ( .inactive / 1000 | floor ) , ( .windows[] | select (.active == true) |.title) ] | @tsv' \
+ | tac | while read -r sec l; do
+ if (( i % 6 == 0 && i >= 2 )); then
+ echo == $(( i / 6 + 1 )) ==
+ fi
+ if (( sec > 10 )); then
+ printf "%3d %s\n" $sec "$l"
+ else
+ printf " %s\n" "$l"
+ fi
+ i=$(( i + 1 ))
+ done
+}
+
+arbttlog() {
+ # from the log, show only the currently active window, and the number of
+ # seconds of input inactivity.
+ arbtt-dump "$@" | grep -v '( )\|Current Desktop' | sed -rn '/^[^ ]/{N;s/^(.{21})([0-9]*)[0-9]{3}m.*\(\*/\1\2/;s/^(.{21})[0-9]*.*\(\*/\1/;s/\n//;p}' ; }
idea() {
/a/opt/idea-IC-163.7743.44/bin/idea.sh "$@" & r
wian() {
cat-new-files /m/4e/INBOX/new
}
+wakehours() {
+ local sec
+ if (( $# != 1 )) ; then
+ echo wakehours: error: expected 1 arg, got $# >&2
+ return 1
+ fi
+ sec=$(( EPOCHSECONDS - $( date +%s -d $1am ) ))
+ printf "%d:%02d\n" $(( sec / 60 / 60)) $(( (sec / 60) % 60 ))
+}
+
+calvis() { # calendar visualize
+ install -m 600 /dev/null /tmp/calendar-bytes
+ while read l; do
+ for char in $l; do
+ printf "\x$(printf "%x" $char)" >>/tmp/calendar-bytes
+ done
+ done < <(grep -v '[#-]' /p/calendar-data)
+ /p/c/proc/calendar/linux-amd64/calendar
+}
wtr() { curl wttr.in/boston; }
;;&
*)
if $at_home; then
- if ! $kd_spread; then
+ if ! $kd_spread && [[ $HOSTNAME != x3 ]]; then
# main work machine
if ping -q -c1 -w1 x3.office.fsf.org &>/dev/null; then
targets+=(x3.office.fsf.org)
+ elif ping -q -c1 -w1 $h.b8.nz &>/dev/null; then
+ # in case we took it home
+ targets+=(x3.b8.nz)
else
targets+=(x3wg.b8.nz)
fi
fi
# temporarily disabled while doing recovery
-# for h in frodo kd; do
+ # for h in frodo kd; do
for h in kd; do
if [[ $HOSTNAME == "$h" ]]; then
continue
fi
targets+=($h.b8.nz)
done
- for h in x2 x3 sy; do
+ for h in x2 sy; do
if [[ $HOSTNAME == "$h" ]]; then
continue
fi
if [[ $HOSTNAME == "$HOST2" ]]; then
prospective_mps+=(/a /ar /qr /q)
fi
+ if $kd_spread; then
+ prospective_mps=(/a /ar /o /qr /q)
+ fi
fi
# note: put q last just in case its specific retention options were to
# affect other config sections. I havent tested if that is the case.
done
fi
+if (( ! ${#mountpoints[@]} )); then
+ die didnt get mountpoint arg and had no defaults
+fi
+
echo "mountpoints: ${mountpoints[*]}"
##### end command line parsing ########
# we dont want t, instead c for checksum.
# That way we dont set times on directories.
# -a = -rlptgoD
- cmd=( s rsync -rclpgoDiSAX --chown=root:root
+ cmd=( s rsync -rclpgoDiSAX --chmod=Dg-s --chown=root:root
--exclude=/etc/dovecot/users
--exclude='/etc/exim4/passwd*'
--exclude='/etc/exim4/*.pem'
# general known for debian/ubuntu, not for fedora
m /a/bin/buildscripts/go
-m /a/bin/buildscripts/rust
+# only needed for rg. cargo takes up 11 gigs, filled up the disk on je.
+#m /a/bin/buildscripts/rust
m /a/bin/buildscripts/misc
m /a/bin/buildscripts/pithosfly
#m /a/bin/buildscripts/alacritty
for (( i=0; i<3; i++ )); do
systemctl suspend
- wall -n spend: $$ suspending in 30 seconds
- sleep 30
+ echo $$ suspending in 180 seconds
+ sleep 180
done
-wall -n spend: $$ shutdown in 30 seconds
+wall -n spend: $$ shutdown in 180 seconds
shutdown
# file:///usr/share/doc/i3-wm/userguide.html#_border_style_for_new_windows
new_window none
+
+# I dont see a way to make processing windows act like normal windows,
+# this does it.
+# https://unix.stackexchange.com/questions/450700/opening-a-programme-in-a-floating-window-in-i3
+#
+# This is the info for a processing window launched from the ide.
+# I'm not sure I want it like this, so commenting it out for now.
+#for_window [class="processing-core-PApplet" instance="processing-core-PApplet"] floating disable
+
+# this is the processing window for my app named focus.
+for_window [class="focus" instance="focus"] floating disable
# it seems like some versions of spamassassin do BODY_SINGLE_WORD, others dont, we dun care.
# bayes_00 is a new one indicating ham, we dont care if its missing.
BAYES_00|BODY_SINGLE_WORD|FROM_FMBLA_NEWDOM*|autolearn) : ;;
+
+ # These have somewhat randomly been added and removed, resulting in useless alerts, so ignore them.
+ RCVD_IN_DNSWL_MED|DKIMWL_WL_HIGH) : ;;
+
SPF_HELO_NEUTRAL)
# some of my domains use neutral spf, treat them the same.
results[SPF_HELO_PASS]=t
keys=(DKIM_SIGNED DKIM_VALID{,_AU,_EF} SPF_HELO_PASS SPF_PASS TVD_SPACE_RATIO)
if [[ $to == *@gnu.org && $from == *@gnu.org ]]; then
keys=(ALL_TRUSTED TVD_SPACE_RATIO)
- elif [[ $to == *@gnu.org ]]; then
- # eggs has RCVD_IN_DNSWL_MED
- keys+=(RCVD_IN_DNSWL_MED)
- elif [[ $from == *@gnu.org ]]; then
- # eggs has this. it used to have DKIMWL_WL_HIGH sometime in 2022
- keys+=(RCVD_IN_DNSWL_MED)
+ # from eggs had DKIMWL_WL_HIGH sometime in 2022, then DKIMWL_WL_MED unti march 2023
fi
for t in ${keys[@]}; do
esac
done
for miss in ${missing[@]}; do
- # We expect dns failures from time to time, so
- # we count them separately and alert differently.
+ # At some point we had annoying dns failures that we couldn't solve so we
+ # we counted dns fail related results separately and alert differently.
+ # DKIM_VALID|DKIM_VALID_AU|DKIM_VALID_EF|SPF_HELO_PASS|SPF_PASS|
case $miss in
- # iank: dns fail
- # DKIM_VALID|DKIM_VALID_AU|DKIM_VALID_EF|SPF_HELO_PASS|SPF_PASS|
- RCVD_IN_DNSWL_MED|DKIMWL_WL_HIGH)
- missing_dnswl+=1
- ;;
*)
unexpected+=1
;;
apt-show-versions
aptitude-doc-en
arandr
+ arbtt
# dictionary / thesaurus
artha
asciidoc
readline-doc
rename
reportbug
+ # first exist in t11 afaik
+ ripgrep
rfkill
rng-tools
rygel
# DO NOT USE THIS ONE.
#keyserver hkp://pool.sks-keyservers.net
-keyserver hkp://keys.openpgp.org
+#keyserver hkp://keys.openpgp.org
#keyserver hkp://pgp.mit.edu
#keyserver hkp://keyserver.pgp.com
#keyserver hkp://ipv4.pool.sks-keyservers.net
#keyserver hkp://keys.gnupg.net
-#keyserver hkp://keyserver.ubuntu.com
+keyserver hkp://keyserver.ubuntu.com
#keyserver hkp://keyring.debian.org
#keyserver keyserver.ubuntu.com
# more secure hkps, but had problems with my gpg version
# /a gets remounted due to btrbk, ignore error code for file doesnt exist
source /a/bin/bash_unpublished/source-state || [[ $? == 1 ]]
fi
+
+
+ ## check if last snapshot was recent
+ old_snap_limit=$(( 3 * 60 * 60 ))
+ for vol in a o q; do
+ case $vol in
+ o) btrbk_root=/mnt/o/btrbk ;;
+ *) btrbk_root=/mnt/root/btrbk ;;
+ esac
+ # this section generally copied from btrbk scripts, but
+ # this part modified to speed things up by about half a second.
+ # I'm not sure if its quite as reliable, but it looks pretty safe.
+ # Profiled it using time and also adding to the top of the file:
+ # set -x
+ # PS4='+ $(date "+%2N") '
+ # allow failure in case there are no snapshots yet.
+ # shellcheck disable=SC2012
+ shopt -u nullglob
+ files=($btrbk_root/$vol.20*)
+ shopt -s nullglob
+ snaps=()
+ if (( ${#files[@]} )); then
+ snaps=($(ls -1avdr "${files[@]}" 2>/dev/null |head -n1 || : ))
+ fi
+ now=$EPOCHSECONDS
+ maxtime=0
+ for s in ${snaps[@]}; do
+ file=${s##*/}
+ t=$(date -d $(sed -r 's/(.{4})(..)(.{5})(..)(.*)/\1-\2-\3:\4:\5/' <<<${file#$vol.}) +%s)
+ if (( t > maxtime )); then
+ maxtime=$t
+ fi
+ done
+ snapshotmsg=
+ last_snap_age=$(( now - maxtime ))
+ last_snap_hours=$(( last_snap_age / 60 / 60 ))
+ if (( last_snap_age > old_snap_limit )); then
+ chars+=(OLD-SNAP-${last_snap_hours}h)
+ snapshotmsg="/$vol snapshot older than 4 hours"
+ if [[ $MAIL_HOST == "$HOSTNAME" ]]; then
+ p "$snapshotmsg" | lo -1 old-snapshot
+ fi
+ # not bothering to get info on all volumes if we find an old one.
+ break
+ fi
+ done
+
+
if [[ $MAIL_HOST == "$HOSTNAME" ]]; then
bouncemsg=
fi
p "$bbkmsg" | lo -480 btrbk.timer
- ## check if last snapshot was within an hour
- vol=o
- # this section generally copied from btrbk scripts, but
- # this part modified to speed things up by about half a second.
- # I'm not sure if its quite as reliable, but it looks pretty safe.
- # Profiled it using time and also adding to the top of the file:
- # set -x
- # PS4='+ $(date "+%2N") '
- # allow failure in case there are no snapshots yet.
- # shellcheck disable=SC2012
- shopt -u nullglob
- files=(/mnt/o/btrbk/$vol.20*)
- shopt -s nullglob
- snaps=()
- if (( ${#files[@]} )); then
- snaps=($(ls -1avdr "${files[@]}" 2>/dev/null |head -n1 || : ))
- fi
- now=$EPOCHSECONDS
- maxtime=0
- for s in ${snaps[@]}; do
- file=${s##*/}
- t=$(date -d $(sed -r 's/(.{4})(..)(.{5})(..)(.*)/\1-\2-\3:\4:\5/' <<<${file#$vol.}) +%s)
- if (( t > maxtime )); then
- maxtime=$t
- fi
- done
- snapshotmsg=
- if (( maxtime < now - 4*60*60 )); then
- chars+=(OLD-SNAP)
- snapshotmsg="/o snapshot older than 4 hours"
- fi
- p "$snapshotmsg" | lo -1 old-snapshot
# commented out, only using timetrap retrospectively.