From ff06aea2b5eae1c85d866d346071cc68e1cce32f Mon Sep 17 00:00:00 2001 From: Pavel Raiskup Date: Tue, 12 Oct 2021 15:38:46 +0200 Subject: [PATCH] copr-backend: drop an unused cron job --- .../files/delete-forgotten-instances.cron | 5 ---- .../files/delete-forgotten-instances.pl | 28 ------------------- 2 files changed, 33 deletions(-) delete mode 100644 roles/copr/backend/files/delete-forgotten-instances.cron delete mode 100644 roles/copr/backend/files/delete-forgotten-instances.pl diff --git a/roles/copr/backend/files/delete-forgotten-instances.cron b/roles/copr/backend/files/delete-forgotten-instances.cron deleted file mode 100644 index 5f4c191757..0000000000 --- a/roles/copr/backend/files/delete-forgotten-instances.cron +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/bash - -source /home/copr/cloud/ec2rc.sh -/home/copr/delete-forgotten-instances.pl - diff --git a/roles/copr/backend/files/delete-forgotten-instances.pl b/roles/copr/backend/files/delete-forgotten-instances.pl deleted file mode 100644 index 8aa5d41f78..0000000000 --- a/roles/copr/backend/files/delete-forgotten-instances.pl +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/perl -# this scrip query for all running VM and terminate those -# which are not currently started by some ansible script - -while (chomp($a = qx(ps ax |grep -v 'sh -c ps ax' |grep /home/copr/provision/builderpb.yml | grep -v grep))) { - # we are starting some VM and could not determine correct list of running VMs - sleep 5; -} - -#print qx(ps ax |grep ' 172.16.3.' |awk '{ print \$33 }'); -@IPs = split('\s+', qx(ps ax |grep ' 172.16.3.' |awk '{ print \$33 }')); - -#print "Running instances\n"; -#print join(", ", @IPs), "\n"; -for my $i (@IPs) { - $check{$i} = 1; -} - -@instances = split('\n', qx(/bin/euca-describe-instances)); -@TO_DELETE = (); -for my $i (@instances) { - my @COLUMNS = split('\s+', $i); - next if $COLUMNS[0] eq 'RESERVATION'; - #print $COLUMNS[1], ", ", $COLUMNS[15], "\n"; - push(@TO_DELETE, $COLUMNS[1]) unless $check{$COLUMNS[15]}; -} -$id_merged = join(" ", @TO_DELETE); -qx|euca-terminate-instances $id_merged| if ($id_merged);