Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F63276195
repo-size.sh
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Sat, May 18, 23:53
Size
650 B
Mime Type
text/x-shellscript
Expires
Mon, May 20, 23:53 (2 d)
Engine
blob
Format
Raw Data
Handle
17754080
Attached To
rPHINFRA c4science
repo-size.sh
View Options
#!/bin/bash
SIZE=$(ssh c4science-backup du --max-depth=1 /backup/repo/)
#SIZE=$(cat /tmp/size)
SORT=$(echo "$SIZE" | sort -n)
LIMIT=2 #GB
echo '| size | repo id | repo name | username | email'
echo '| --- | --- | --- | --- | ---'
while read -r i; do
size=$(echo $i | awk '{print $1,"*1024"}' | bc )
if [ "$size" -gt "$(($LIMIT*1024*1024*1024))" ]; then
repo=$(echo $i | awk '{print $2}' | cut -c 14-)
info=$(./get_repo_info.sh $repo | tail -n 1)
echo -n "| $(echo $size | numfmt --to=iec --suffix=B) "
echo -n "| R$repo "
echo $info | awk '{print "| ",$1," | ",$2," | ",$3}'
fi
done <<< "$SORT"
Event Timeline
Log In to Comment