From 79670053c7247d3a49b607960efd284e93f057e5 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Fri, 2 Aug 2013 17:14:26 -0500 Subject: install.pl --- bin/flushrms.pl | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100755 bin/flushrms.pl (limited to 'bin/flushrms.pl') diff --git a/bin/flushrms.pl b/bin/flushrms.pl new file mode 100755 index 0000000..058b582 --- /dev/null +++ b/bin/flushrms.pl @@ -0,0 +1,31 @@ +#!/usr/bin/perl + +use localbucky; +use lib "/var/www/vhosts/carbonpictures.com/bucky/lib"; +use Bucky1; + +$dbh = DBI->connect ("DBI:mysql:$BUCKY_DB:localhost;mysql_read_default_file=$BUCKY_DB_CNF"); + +# $DEBUG = 1; + +$threads = get_threads(); +$fucker = ""; +$max = 1; + +foreach $t (@$threads) + { + $fucker = add_key($fucker, $t->{id}); + $max = $t->{id} if ($t->{id} > $max); + } + +for ($i = 32; $i <= $max; $i++) + { + if (-e "$data_path/$i" && !check_key($fucker, $i)) + { + print "Deleting $i\n"; + system("/bin/rm", "-rf", "$data_path/$i"); + } + } + +$dbh->disconnect(); + -- cgit v1.2.3-70-g09d2