#!/usr/bin/perl
#################################################
# version 1.1
#
# Clean old cpanel backups
#
# Author: Igor Russian
##################################################
use Date::Parse;
my @all_dirs = ('/backup/cpbackup/daily', '/backup/cpbackup/weekly');
my $query = "ls -l |";
my $expire_day_period = 30; # Number of days
my $expire_period = $expire_day_period * 24 * 60 * 60 ; # expire_day_period in seconds
my $i=1;
my @rm_dirs = ();
my @dir_en = ();
my $type;
my $name;
my $group;
my $mtime;
my $diff_time;
#If backup ...