13

Perl Script to find the disk usage and to delete the files which is consuming more space

view full story
linux-howto

http://www.unix.com – Hi All, I have written a script to check the file system usage and to delete the files which is consuming more space.Please check whether the script is corrcet #Script Starts here #!/usr/local/bin/perl #Program to find the disk space and to delete the older files #Checks the type of OS here $OS = `uname -a | awk '{print $1}'`; print ("The Operating System is $OS"); if ($OS == SunOS ) { print ("Enter the filesystem related to SUN \n"); $FILESYSTEM = <STDIN>; $DF = `df -sk $FILESYSTEM | awk '{print $3,$4,$5}' | awk '{if($3>50)print $3}'`; (HowTos)