This is going to be useful for me for a couple of reasons.  First, I've got
a machine at work that mysteriously fills up, and more importantly, I can
monitor my Minecraft server at home. ;)

However, I've run into a few problems, so I'm offering my findings and
fixes.

The first, line 3, you've got a reference to a script that doesn't exist
AFAIK.  You should maybe put a check to see if the file exists first,
before running it.  I just deleted that entry from my version of the script.

On line 8, I'm erroring out with "declare: not found".  At first I thought
it might be something to do with regexp, but even changing it to a static
file name, it still bombs.  Then I realized that the file needs to be
executable.  With a chmod, that works.

Third, my version of df doesn't seem to support the --output parameter.
I've checked online man pages and I can't find an example or a man page
containing that parameter.  Removing the parameter, it still works.

Fourth, I'd maybe suggest that you either run a delete prior to updating
for todays date, or, change the resolution of the date to the accuracy of a
second.  The reason being is if you want to test (Like I'm doing) you're
going to run into constraint violations. With changing to a second
resolution, you can run it multiple times to get more results to get real
time info.  I'll also be changing my version so it doesn't show human
readable since I'll be looking at a few KB worth of changes at a time.

On my MC server, I have the current partition setup:
rootfs    36G  19G  15G 57% /
udev      10M    0  10M 0% /dev
tmpfs    397M 164K 397M 1% /run
/dev/disk/by-uuid/75b09020-4711-48d3-a664-7024a0d16db8  36G  19G  15G 57% /
tmpfs    5.0M    0 5.0M 0% /run/lock

The fact that I have two  / mentioned, it errors out.  This might be an
edge case, but, just something I came across.  I'll have to filter out
either rootfs or dev/disk.  I'll need to see how the work machines are
setup (They're Redhat, I'm using Debian at home right now) so I'll decide
what happens then.

And finally, maybe not the scripts fault, but there was an oddball
directory made by one of the Minecraft mods that pooched the script.
Literally, the directory was
"_!'0!bw"k!(}!~@"y!(:!a@"v!'4!d!"y!'%!}w"r!'`!cg!x!#4!;w!u!$%!:!==".
I deleted the directory, and it went through completely.  I'll just modify
the script to ignore this particular directory.

All in all, excellent example.

On Fri, Jan 29, 2016 at 12:47 PM, Cecil Westerhof <cldwesterhof at gmail.com>
wrote:

> I wrote the following article:
>     ??
> Use Bash to Store Disc Info in SQLite
> ?    ?
>
> https://www.linkedin.com/pulse/use-bash-store-disc-info-sqlite-cecil-westerhof
>
> ?No rocket science, but I thought it could be interesting.
> ?
>
> --
> Cecil Westerhof
> _______________________________________________
> sqlite-users mailing list
> sqlite-users at mailinglists.sqlite.org
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>

Reply via email to