Just a short reply, because I should be sleeping now. ;-) 2016-01-30 1:14 GMT+01:00 Stephen Chrzanowski <pontiac76 at gmail.com>:
> 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. ;) > ?I am glad it is useful.? > 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. > ?That is my bash library. I will change it so you can use the script without the library. ? > 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. > ?Strange, when I check it out the bits are correctly set. But I will add a note about it.? 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. > ?I will look into that also. What does ?df --version? give and which version of Linux are you using? (uname -a) ? > 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. > ?My idea was that you only run it once a day. But I will change that it can be run on minute base also. I will also implement a parameter to get rid of human readable. ? > 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. > ?I would only use partitions? ? that are mounted on /dev/... But that is the nice thing about this solution: what is stored is driven by the database. > 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. > ?You do not need to delete the directory, just do not put it in the database to be processed. :-D > All in all, excellent example. > ?Thank you. ? > 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 > > > _______________________________________________ > sqlite-users mailing list > sqlite-users at mailinglists.sqlite.org > http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users > -- Cecil Westerhof