Deleting access_log.processed in crontab


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Deleting access_log.processed in crontab
# 1  
Old 07-01-2008
Deleting access_log.processed in crontab

Hi,

I've worked out that my server was getting clogged with the access_log.processed file.

I deleted it using the command
> /var/www/vhosts/domain.com/statistics/logs/access_log.processed

I also set that up as a crontab job for every Wednesday.

What I was wondering is the version using some wildcard to delete the file off every domain on the server.

I tried

> /var/www/vhosts/*/statistics/logs/access_log.processed

but it says ambiguous redirect.

Thanks,
Travis
# 2  
Old 07-01-2008
find would be an easier option, somethikng like this should work.

Code:
find /var/www/vhosts/ -type f -name access_log.processed -exec rm {} +

# 3  
Old 07-01-2008
Nice one thanks.

Just another thought. Should I delete all processed files?

So use

find /var/www/vhosts/ -type f -name *.processed -exec rm {} +

?
# 4  
Old 07-01-2008
you could, but if you use a wildcard you will need to quote it, so "*.processed", not *.processed
# 5  
Old 07-01-2008
Thanks

That should work.
I'll find out on Wednesday. :-)
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Access_log parsing and blocking ip

Hello, my website under http get attack. When i check the access_log i can see like this. xx.xxx.xxx.xxx - - "GET //wp-admin/blabla/test.php?jASHSSAsgaGSAgsASGIGIG HTTP/1.1" 200 0 "-" "-" xxx.xxx.x.xx - - "GET //wp-admin/blabla/test.php?jASHSSAsgaGSAgsASGIGIG HTTP/1.1" 200 0 "-" "-" ... (3 Replies)
Discussion started by: SAYGIN
3 Replies

2. UNIX for Dummies Questions & Answers

Crontab deleting files command question

Hello out there, Our system has a pdf generator that creates pdf files. We dont need them pas 120 days. So I have this command in my crontab. I currently set it to "0" for testing. But normally have it set to -mtime 120 to remove files out of the folders from PDF out to several other potential... (7 Replies)
Discussion started by: vsekvsek
7 Replies

3. Linux

Finding IP info from access_log file

I found the /var/www/logs/access_log file (access log in order to find specific information about IP, And when users last logged in.) but in my fedora the access_log file is is in my /var/log/cups and it looks different from what it should be. Why is that? my goal is to get a list of IP... (4 Replies)
Discussion started by: bugenhagen_
4 Replies

4. Web Development

Include CFTOKEN and CFID in apache access_log

hi folks, how to write CFID and CFTOKEN cookie in apache logs ? can you give me a link or howtos in doing this. thanks in advance (0 Replies)
Discussion started by: linuxgeek
0 Replies

5. Shell Programming and Scripting

output file of the shell script running through crontab is deleting automatical daily.

Dear Friends, I am working on IBM AIX. I have written one script and kept in the crontab as to run daily at 11:38 AM. and the output of the script to be appended to the file generated with the month name. but my file deleting daily and the new file is creating with the output of the shell... (2 Replies)
Discussion started by: innamuri.ravi
2 Replies

6. Shell Programming and Scripting

remember processed files

Hello dear community! I have the following task to accomplish: there is a directory with approximately 2 thousand files. I have to write a script which would randomly extract 200 files on the first run. On the second run it should extract again 200 files but that files mustn't intersect with... (5 Replies)
Discussion started by: sidorenko
5 Replies

7. Solaris

how to grep or egrep pattern of apache access_log file

Hi I need to look for the range dates of access_log for example: between 02/May/2009:14:56:20 and 05/May/2009:18:46:06 then write the content to another file. Date and time is very important for me to concatenate them into access_log later. Thanks (2 Replies)
Discussion started by: lamoul
2 Replies

8. Shell Programming and Scripting

Deleting processed lines

I have a log file that I am processing. This contains messages from and to a server (requests and responses). The responses to requests may not be in order i.e. we can have a response to a request after several requests are sent, and in some error cases there may not be any response message. ... (2 Replies)
Discussion started by: BootComp
2 Replies

9. UNIX for Dummies Questions & Answers

mail access_log

i am trying to figure a way to email my access_log twice a month to myself right before the system zeros it. using crontab is the way to go, but the command to get mail to do the job is my problem. #------------------------------------------- #0-59 0-23 1-31 1-12 0-6 (0=Sunday) #min hour... (3 Replies)
Discussion started by: dayglow
3 Replies

10. Cybersecurity

/var/log/httpd/access_log

Yesterday I happened to check /var/log/httpd/access_log and found some funny things like these, 209.127.62.159 - - "GET /scripts/root.exe?/c+dir HTTP/1.0" 404 210 209.127.62.159 - - "GET /MSADC/root.exe?/c+dir HTTP/1.0" 404 208 209.127.62.159 - - "GET /c/winnt/system32/cmd.exe?/c+dir... (3 Replies)
Discussion started by: eddie
3 Replies
Login or Register to Ask a Question