I admin a FTP server and need help setting something up to allow the FTP users to see if their individual share is full.
A Fedora Core 6 system running vsftp using LVM to segregate FTP shares (matching the directory names to the logical volume names).
Also, there are multiple accounts per share (ex: share "sales" has accounts "john" and "tom" that are separate chrooted directories inside of the "sales" Logical Volume.
I have a cron script that does this:
df -H /dev/mapper/SCSI_RAID5-LogVolName | grep -v /dev/mapper/SCSI_RAID5-LogVolName | cut -c 24-47 > /data/LogVolName/ShareName/_FTP_Usage.txt
Results look like this:
Size Used Avail Use%
37G 33G 2.9G 92%
I couldn't figure out how to put the usage info into the file name (just an empty file titled "Usage-2.9G_Avail_out_of_37G.txt" or something) and each login/account needs to be a separate line of code.
What I'm looking for is help writing a script that will dynamically read which LogVols are currently in use then create files titled with account usage info written into the root of the appropriate account directories.
Any ideas? Even if you can just get me part of the way... any little bit helps. And if I'm totally missing the mark on this then please tell me! Anyway to let users see the amount of available space in their share will do the job.