diff options
| author | Jules Laplace <carbon@melanarchy.org> | 2013-08-02 17:14:26 -0500 |
|---|---|---|
| committer | Jules Laplace <carbon@melanarchy.org> | 2013-08-02 17:14:26 -0500 |
| commit | 79670053c7247d3a49b607960efd284e93f057e5 (patch) | |
| tree | 9617f6eefa38b2686ae409bf75cc27a340444eda /bin/flushrms.pl | |
| parent | c53827d5d044ae5ca7ebb27acb404b7a8988918e (diff) | |
install.pl
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(); + |
