I run a server that stores a vast amount of information in this format:
I need some help to put together a bash script to do..
1. Read from a plain text file what usernames to check (located anywhere on server - not important where)
2. Check usage for the users individual directories (du -h)
2. Read an xml file in the files directory to extract a translation of what the numbered directory is. Our system stores a plain English name of the numbered directory, IE: JohnsPc in the XML file
3. Produce and email like so ..
JohnsPc = 12GB (this is actually df -h of the 2778346321 directory)
MarysPc = 4GB
JacksPc = 1GB
It would then email to an address located in the plain text file with the username, the results above.
IE: The plain text file, is so I can edit it and easily add new usernames and email addresses to it.
EG, Text File would look like
The xml file for each numbered dir looks like this, below. And is in a file called info.xml in the root of the each numbered dir.
<Name="JohnsPc" id="2778346321" />
I feel I am asking a lot here. Is it possible to even do this?
My command line experience is very limited to very basic things only. But always looking to learn more.
Appreciate any feedback at all.