Search Results

Search: Posts Made By: medic
3,733
Posted By medic
Thanks for the fast reply. As always you...
Thanks for the fast reply.

As always you found the problem, it was:


if files.startswith("."):
#break <<<----------- you are breaking out...
3,733
Posted By medic
The problem is not to skip the htaccess file, it...
The problem is not to skip the htaccess file, it is the effect that files have on python.

So here is the code for example:


#!/usr/bin/env python

import os

outfile =...
3,733
Posted By medic
Make python script ignore .htaccess
I just wrote a tiny script with the help of ghostdog74 to search all my files for special content phrases.

After a few modifications I now made it work, but one problem is left. The files are...
34,864
Posted By medic
Thanks again for your help.
Thanks again for your help.
34,864
Posted By medic
Okay, now I got it. Thanks for all you help, I...
Okay, now I got it. Thanks for all you help, I will now go ahead with my guides.

Just one question, could you recommend a good python editor?
5,971
Posted By medic
From what you explained me python is a very nice...
From what you explained me python is a very nice way to write such files. I just need to ensure that the scanner is not stopping its work after 1 hour because that happened.

It will wait till the...
34,864
Posted By medic
Thanks for the fast reply, that works, but where...
Thanks for the fast reply, that works, but where is the big difference ?

Is there any reason why my posted code is just always telling that there is no directory?
5,971
Posted By medic
I already added such a line that is always...
I already added such a line that is always telling me what the script is doing, but I think there are really a lot of files.

There are about 1000 public_html directories and every folder has about...
34,864
Posted By medic
As a found it at nearly every beginner guide,...
As a found it at nearly every beginner guide, with the os.listdir option I am listing all files and folders within my directory and the os.path.isdir is used to find out that one is a file or a...
34,864
Posted By medic
os.path.isdir is always returning false
Just started with learning python and tried something, most people here would call more than simple.

I just wanted to list all directories within my main directory. So I user the following code:
...
5,971
Posted By medic
After my final test, I just found a problem...
After my final test, I just found a problem again.

I started the scanner to search for about 5 phrases and write the files into my result file, that works fine so far. But after about an hour and...
5,971
Posted By medic
Thanks again for the answer, I just want to...
Thanks again for the answer, I just want to search all sub directories, so it should work as you already wrote in code example.

I will now start my final test with a few more arguments to find. ;)...
5,971
Posted By medic
@ghostdog74 Thanks for that piece of...
@ghostdog74

Thanks for that piece of beautiful code. :D

I just modified it to save the path of the file with the content of the line und the load is more than okay. The maximum I have seen...
5,971
Posted By medic
Just did some more testing. The problem seems to...
Just did some more testing. The problem seems to be find . I think there are too many files and subfolders. I just tried to limit the folder depth and it worked, for a smaller amount of files.

I...
5,971
Posted By medic
That code works now, but it has the same problem...
That code works now, but it has the same problem as the I started with. It starts working and after a few minutes the used cpu and mem goes down to nearly 0 and thats it.

I am not a Pro, so are...
5,971
Posted By medic
Okay, just found my fault, it was just the copy...
Okay, just found my fault, it was just the copy paste of the grep parameters.
5,971
Posted By medic
Just found the problem. The first part of the...
Just found the problem. The first part of the code is working fine, but grep is producing some problems.

I just tried to scan for more than one phrase and there the problem occurs.

find...
5,971
Posted By medic
Thanks for the reply, I just tried your code but...
Thanks for the reply, I just tried your code but got some problems.

First I just tried:

find /home/userid*/public_html/ -size -2048k | xargs grep -Eil 'phrase1|phrase2' >...
5,971
Posted By medic
I just got the tip to use find with xargs and...
I just got the tip to use find with xargs and grep to solve that problem, but my combinations just wont works. Hopefully someone could help, because I have never tried something like that before.
...
5,971
Posted By medic
Need some help with shell content scanner
Just started to create my own small content scanner that searches all the visible files on my server, but now I got stuck. It should be used to scan the files for phrases like in the following...
Showing results 1 to 20 of 20

 
All times are GMT -4. The time now is 08:02 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy