defrag after upgrade

This commit is contained in:
Bob Mottram 2017-06-12 14:02:19 +01:00
parent f8aefec776
commit 5e92fa6bea
2 changed files with 9 additions and 0 deletions

View File

@ -101,6 +101,7 @@ if [ -d $PROJECT_DIR ]; then
fi
lockdown_permissions
defrag_filesystem
fi
fi

View File

@ -87,4 +87,12 @@ function install_tomb {
mark_completed $FUNCNAME
}
function defrag_filesystem {
fs_type=$(stat -f /)
if [[ "$fs_type" == *"btrfs"* ]]; then
btrfs filesystem defragment -v -r /
fi
}
# NOTE: deliberately no exit 0