admin-scripts/record_mastodon_media_size.bash
Jeffrey Serio 56e9c3b6cc Rearrange
2024-08-15 20:34:54 -05:00

16 lines
483 B
Bash
Executable File

#!/usr/bin/env bash
# /etc/cron.daily/record_mastodon_media_size.bash
set -euo pipefail
RECORD_FILE="/var/log/mastodon_media_size.log"
file_count=$(sudo /home/jas/.cargo/bin/dust -c -P -d 0 -b -f -R -p /home/mastodon/live/public/system | awk '{print $3}')
sudo /home/jas/.cargo/bin/dust \
-c -P -d 0 -b -R -p \
/home/mastodon/live/public/system |
awk -v fc="$file_count" -v tstamp="$(date '+%Y-%m-%d-%H%M%S')" '{print tstamp,$1,$3,fc}' |
tee -a "${RECORD_FILE}"