CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner:
df -h /du -h output

 



Fleximous
New User

Oct 24, 2013, 11:09 AM

Post #1 of 3 (534 views)
df -h /du -h output Can't Post

Hello,

I'm new to Perl and want to be able to run a df -h and du -h against a number of volumes and log this output to a DB. At the moment I would like to just be able to log this output to a file, and look at the DB part at a later date.

What I would like to do is I have a number of directories and daily I want to run a du -h against these directories and finally graph the data, so I can see on a daily basis on a size of a directory.

Would someone be able to point in a direction on how to do this?


BillKSmith
Veteran

Oct 24, 2013, 12:03 PM

Post #2 of 3 (530 views)
Re: [Fleximous] df -h /du -h output [In reply to] Can't Post

The commands 'du' and 'df' are not perl commands. (I assume that they are UNIX shell commands.) It is possible (even easy) to run shell commands from within perl. This is not a good idea for production software, especially software that you are already planning on enhancing. I am certain that the functions that you require are avilable in pure Perl. (refer: perldoc perlfunc)

Perl is an excelent language choice for your DB interface. (Refer to CPAN module DBI)

You will probably want to generate your graphics on a server and display them in the user's browser. Perl's CGI module will become your friend.
Good Luck,
Bill


FishMonger
Veteran / Moderator

Oct 24, 2013, 12:12 PM

Post #3 of 3 (529 views)
Re: [Fleximous] df -h /du -h output [In reply to] Can't Post

Take a look at these 2 modules.

du - display disk usage statistics
http://search.cpan.org/~cwest/ppt-0.14/bin/du

Filesys::Df - Perl extension for filesystem disk space information.
http://search.cpan.org/~iguthrie/Filesys-Df-0.92/Df.pm

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives