SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    SitePoint Zealot
    Join Date
    May 2000
    Location
    UK
    Posts
    197
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    OK, here goes. I would greatly appreciate help from anyone on this.

    My site www.homepagetools.com hosts UltraBoard's. I need a way to know if these UltraBoard's are not being used.

    I have figured out a way of doing this using the -A file test. The following code explains it:

    <BLOCKQUOTE><font size="1" face="Verdana, Arial">code/font><HR><pre>open (UB,"/home/homepagetools/www/ultraboard/21stcentury/UltraBoard.pl");

    if (-A UB &gt;= 30.0) {
    die "sorry, this UltraBoard has not been used for over 30 days.";
    }
    else { print "everything is fine"; }

    close (UB);[/code]

    This will tell me if this particular UltraBoard (21stcentury) has not been accessed for over 30 days.

    This is great, but i have over 3500 UltraBoard's!! Can someone please tell me how I can get this script to analyse all 3500 UltraBoard's automatically?

    Thanks,

    Joel Moss www.homepagetools.com

  2. #2
    SitePoint Zealot
    Join Date
    May 2000
    Location
    Duluth, MN USA
    Posts
    166
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    What about setting up an array with all the names of your boards and just having that check code run through each one? such as:

    foreach $site (@sites) {
    open (UB,"$site/UltraBoard.pl");
    if (-A UB &gt;= 30.0) {
    die "sorry, this UltraBoard of $site has not been used for over 30 days.";
    }
    else { print "everything is fine for $site"; }
    close (UB);
    }

    I know typing 3500 websites into an array is a heck of a lot of typing 100 sites a day you'll be done in a month--sorry don't have an idea for that. cut and paste and cut and paste and cut and paste and cut and paste......maybe that is a job for PHP??
    --Bill

    ------------------
    Lake Superior Smokin' Brews
    www.smokinbrews.com

  3. #3
    SitePoint Zealot
    Join Date
    May 2000
    Location
    UK
    Posts
    197
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    So how could php do it?

    Joel Moss http://www.homepagetools.com

  4. #4
    SitePoint Zealot
    Join Date
    May 2000
    Location
    Duluth, MN USA
    Posts
    166
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Sorry--it was late and I'm probably getting in over my head (typing without thinking ), I meant SQL, but you would still be stuck having to type in a database, unless you have the sites already in a database. I was thinking that you could have a file with all the site addresses in it and have the script open that file and write the addresses into the array. Maybe SQL and MySQL wouldn't make it any easier anyway--just make the information more flexable. There's all this hype around them right now, however. I've just been working with flat files lately, not relational databases and it just seemed that with that much data, if some of it was the same, like the base address /home . . . /ultraboard/ for example it wouldn't involve as much typing. But you could still do that by appending the base address with the variable.
    --Bill

    ------------------
    Lake Superior Smokin' Brews
    www.smokinbrews.com

  5. #5
    SitePoint Zealot
    Join Date
    Feb 2000
    Location
    MI
    Posts
    166
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I hate to say this, but if you don't already have one, you really should have a list of all the "sites" you are hosting. Creating this database of ultraboards will help you in the future probably more than you realize...

    Richard

    ------------------
    richard@brevig.com

    Wise men,
    though all laws were abolished,
    would lead the same lives.
    -Aristophanes (444-380 B.C.)


  6. #6
    Hi there! Owen's Avatar
    Join Date
    Jan 2000
    Location
    CA
    Posts
    1,165
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Here's some psudo-code to do it:

    foreach ($directory read from root ls listing) #that is for EVERY single directory - Ultraboard or not.
    {
    if ($directory/Ultraboard.cgi exists && not modified for 30 days) error message # AND add it to a list for future.
    else #okay. move on folks.
    }

    Should work.

    Owen

    [This message has been edited by Owen (edited June 11, 2000).]

  7. #7
    SitePoint Zealot
    Join Date
    May 2000
    Location
    UK
    Posts
    197
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks guys, but I got it sorted now!

    ------------------
    Joel Moss
    FREE Web Tools: <A HREF="http://www.homepagetools.com
    joelmoss@homepagetools.com" TARGET=_blank>www.homepagetools.com
    joelmoss@homepagetools.com</A>


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •