diff options
Diffstat (limited to 'bin/flushrms.pl')
| -rwxr-xr-x | bin/flushrms.pl | 31 |
1 files changed, 31 insertions, 0 deletions
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(); + |
