in reply to File::Find with sudo from root

I have two suggestions (neither of which is really worth fixing something that's not broken):

  1. It probably doesn't make a huge difference, but I'd chdir to '/dir/to/parse' instead of $FindBin::RealBin.
  2. You might also avoid having to chdir at all (but I'm not sure), if you just run this from apache's crontab instead of root's (crontab -e -u apache).

But, whatever works.

Replies are listed 'Best First'.
Re^2: File::Find with sudo from root
by anotherSmith (Initiate) on Jan 18, 2007 at 22:52 UTC
    Ahhhhhh. didn't cross my mind on option 1. of just chdir to the path that find is starting in. I like that. Saves me from having to load the FindBin.

    The more I think about this though, the more it seems weird to have to do and chdir. File::Find works okay for a while then freaks out. I'm guessing there is a reason that it tries to read the directory that the script is in, but I can't think of what that would be. Not that I'm that concerned now that I have it working....