kdave / btrfsmaintenance

Scripts for btrfs maintenance tasks like periodic scrub, balance, trim or defrag on selected mountpoints or directories.
GNU General Public License v2.0
900 stars 79 forks source link

enable fstrim --verbose option, for one informative line #60

Closed barak closed 4 years ago

barak commented 6 years ago

It would be nice to put information in the logs; here I enable fstrim --verbose, which simply outputs how much was actually trimmed. It might be a good idea to go through and do this systematically for all the other commands too.

kdave commented 5 years ago

I've applied the fstrim --verbose part as there's only a few lines of the output so this does not need to be configurable. The verbose defrag lists a lot of files so this would be better optional. Currently there's an undocumented option BTRFS_VERBOSITY that's used just in the defrag script. Right now the value is used as-is and even unquoted, so this is not completely safe thus it's use is discouraged.

I'm considering options for the verbosity settings, whether one option for all or per script, so the first patch is not applied.