mirror of
https://codeberg.org/hyperreal/admin-scripts
synced 2024-11-25 09:03:41 +01:00
Add record_mastodon_media_size.bash
This commit is contained in:
parent
9b3a02df17
commit
1306269b4e
15
bin/record_mastodon_media_size.bash
Executable file
15
bin/record_mastodon_media_size.bash
Executable file
@ -0,0 +1,15 @@
|
||||
#!/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}"
|
Loading…
Reference in New Issue
Block a user