Results 1 to 5 of 5

Thread: I am in deep trouble please help

  1. #1
    Join Date
    Sep 2008
    Beans
    70

    I am in deep trouble please help

    Hi all

    I have a script that run fine ,Actually if find 777 directory and take its count and report,There is no problem with the script.But our reporting system have some limitation that dont allow more then 1000 directory to report,Now i want some way i can break this up and then report to the reporting system,My code is below,At the moment there are like 5000 777 directories.Please help i am blanked.Please its very urgent
    Code:
    #!/bin/bash
    
    check=/var/www/html
    
    
    res=$(find $check -type d -perm 777 2>/dev/null )
    count=$(find $check -type d -perm 777 | wc -l)
    
    echo $count
    #echo $res
    
    Reporting system command.

  2. #2
    Join Date
    Jun 2006
    Location
    CT, USA
    Beans
    5,267
    Distro
    Ubuntu 6.10 Edgy

    Re: I am in deep trouble please help

    5000+ directories? That's obviously bad design

    create 2 level structure, instead of directory /abcd have /ab/abcd - and you are fine

  3. #3
    Join Date
    Sep 2008
    Beans
    70

    Re: I am in deep trouble please help

    I cant do thid becz its a dev server for programmer

  4. #4
    Join Date
    Apr 2008
    Beans
    221

    Re: I am in deep trouble please help

    Quote Originally Posted by aliahsan81 View Post
    Hi all

    I have a script that run fine ,Actually if find 777 directory and take its count and report,There is no problem with the script.But our reporting system have some limitation that dont allow more then 1000 directory to report,Now i want some way i can break this up and then report to the reporting system,My code is below,At the moment there are like 5000 777 directories.Please help i am blanked.Please its very urgent
    Code:
    #!/bin/bash
    
    check=/var/www/html
    
    
    res=$(find $check -type d -perm 777 2>/dev/null )
    count=$(find $check -type d -perm 777 | wc -l)
    
    echo $count
    #echo $res
    
    Reporting system command.
    Use an output file. Try something like:
    #!/bin/bash

    check="/var/www/html"


    find $check -type d -perm 755 > junk
    res=`cat junk | wc -l`

    printf "\nThe number of directories with 755 permisions is $res.\n";

    rm -f junk

  5. #5
    Join Date
    Aug 2008
    Beans
    Hidden!

    Re: I am in deep trouble please help

    Quote Originally Posted by aliahsan81 View Post
    I cant do thid becz its a dev server for programmer
    Whatduzþismean?

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
  •