Index: [Article Count Order] [Thread]

Date:  Tue, 27 Mar 2007 15:38:26 -0700
From:  "Ken Marcus - Precision Web Hosting, Inc." <kenmarcus (at mark) precisionweb.net>
Subject:  [coba-e:09329] Re: Deleting all Vsites
To:  <coba-e (at mark) bluequartz.org>
Message-Id:  <05da01c770c0$a2b8cbc0$6700a8c0@OfficeKen>
References:  <460993C6.9050704 (at mark) businessws.com>
X-Mail-Count: 09329


----- Original Message ----- 
From: "Jason Humphrey" <jasonh (at mark) businessws.com>
To: <coba-e (at mark) bluequartz.org>
Sent: Tuesday, March 27, 2007 2:59 PM
Subject: [coba-e:09328] Deleting all Vsites


> Anyone know a quick way to remove all users and vsites??
> 
> I guess the answer will use cdelvsite.
> 
> -- 
> Kind regards,
> 
> Jason Humphrey
> 
> E: jasonh (at mark) businessws.com
> M: 07786 393418
> T: 0870 8965598
> 


Jason

If you put a list of the sites into a file named: listofsites.txt
ls -1 /home/sites >> listofsites.txt



Then make a file like   delistes.pl   with the contents below, and run it.


#!/usr/bin/perl
#remove  all the sites on list

print "Try to open listofsites.txt\n";
open (FIL,"listofsites.txt") or die "Can't Open\n";
  while (<FIL>) {
  $thedomain =  $_;
  chomp $thedomain;
  print "delete the site $thedomain\n";
  #system("/usr/sbin/cdelvsite -d $thedomain");
  system("/usr/sbin/cdelvsite --fqdn $thedomain");

}

close (FIL);

exit;