Add zfs_trim.sh
This commit is contained in:
parent
677a72700d
commit
825edbe388
17
zfs_trim.sh
Executable file
17
zfs_trim.sh
Executable file
@ -0,0 +1,17 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
# ZFS Trim script
|
||||||
|
|
||||||
|
POOLS=($(cat ~/.zfs_trim_pools))
|
||||||
|
POOLS_STR=""
|
||||||
|
|
||||||
|
for pool in "${POOLS[@]}"; do
|
||||||
|
echo "Trim $pool"
|
||||||
|
zpool trim $pool
|
||||||
|
POOLS_STR="$POOLS_STR$pool "
|
||||||
|
done
|
||||||
|
|
||||||
|
OUTPUT=$(zpool status -t)
|
||||||
|
|
||||||
|
echo "Sending mail..."
|
||||||
|
echo -e "Started trim procedure for $POOLS_STR\n\n$OUTPUT" | $(dirname $0)/mail.sh "ZFS Trim - $(hostname)"
|
||||||
|
echo "Done"
|
Loading…
Reference in New Issue
Block a user