#!/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();