Sponsored Content
Full Discussion: how to delete files by date
Top Forums UNIX for Dummies Questions & Answers how to delete files by date Post 8492 by jamesbond on Friday 12th of October 2001 10:34:42 AM
Old 10-12-2001
Thank you for your help!

I ended up with this :

find /path_to_apache_logs -name "access_log.*" -mtime 1 -exec rm {} \;

One thing I'm wondering about:

I tried 3 things regarding the filenames:

1. single quotes
-name 'access_log.*' -mtime 1 - exec {} \;

2. double quotes
-name "access_log.*" -mtime 1 - exec {} \;

3. filename included in path
path_to_apache_logs/access_log.* -mtime 1 - exec {} \;

All these 3 methods seem to work, but is there a difference in for example using single or double qoutes?


Once again thank you for your assistance!

JamesBond
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Delete files by date

Hi, Can anyone help me delete old files in a directory? Let's say, I want to delete all files which are 365 days old. Thank you. (2 Replies)
Discussion started by: risk_sly
2 Replies

2. Solaris

Delete files according to date

Hi All, I am wondering whether is there a way to remove files according to date. For example, I have 500 files between Jan - April, and I want to remove files created only on March. Is there any way to do this? Thanks in advanced. rgds, Ronny (2 Replies)
Discussion started by: ronny_nch
2 Replies

3. Shell Programming and Scripting

Delete files by date

Hello, Due to an error while processing data I have to delete all files created the 4 october on a RED HAT 3 Server. I am wondering if one of you is aware of a command that could only delete all files that were created the Oct 4 This will be very, very, very helpful Thanks for your... (6 Replies)
Discussion started by: Aswex
6 Replies

4. Shell Programming and Scripting

Delete the files by exact date

we have files created by Aug12 and Feb 23 and Mar10 i want to delete the files which has created on Mar 10 Kindly let me know the script to delete the files which is created by Mar 10 (4 Replies)
Discussion started by: venikathir
4 Replies

5. Shell Programming and Scripting

Needs to delete particular date files in a directory

Hi Guys, I need help on deleting particular date files in a directory. I have to delete thousands of files with respect to particular date. Could anyone help on this to delete particular date files at a time? Thanks in Advance (2 Replies)
Discussion started by: teddy2882
2 Replies

6. UNIX Desktop Questions & Answers

How to delete files from a specific date?

Guys, I am wondering how to remove files for a specific date in a directory? for instance when I do ls -l , i see many files. And i want to delete files for date May 15: 58252015 May 10 03:45 my_05102012.log 58252015 May 15 06:45 my_05152012.log Thanks (8 Replies)
Discussion started by: DallasT
8 Replies

7. Shell Programming and Scripting

Delete log files content older than 30 days and append the lastest date log file date

To delete log files content older than 30 days and append the lastest date log file date in the respective logs I want to write a shell script that deletes all log files content older than 30 days and append the lastest log file date in the respective logs This is my script cd... (2 Replies)
Discussion started by: sreekumarhari
2 Replies

8. UNIX for Dummies Questions & Answers

Delete files of a particular date

dear all, i m a newbie and i want to delete all files of a particular date,how can i do this? your help appreciated,thanks in advance. OS:RHEL 6 (5 Replies)
Discussion started by: mdabdul
5 Replies

9. UNIX for Dummies Questions & Answers

How to delete all the files older than a date?

Hi, I need a command for deleting all the compress files *.Z that are older than the current date - 5 days. Basically I have a directory where daily I meet some back up files and I want to remove automatically the ones 5 days (or more) older than the current date. How can I write a 'rm' command... (1 Reply)
Discussion started by: Francy
1 Replies

10. UNIX for Dummies Questions & Answers

Delete Files from a date

I'm quite new to Unix but I want to delete some old backup files stored in a directory. the backups are stored on a network storage device located at /mnt/terastation12/backup. I want to delete everything upto one month ago. would the following command in Unix Sun do that? find... (5 Replies)
Discussion started by: dbajtr
5 Replies
AnyData::Format::Weblog(3pm)				User Contributed Perl Documentation			      AnyData::Format::Weblog(3pm)

NAME
AnyData::Format::Weblog - tiedhash & DBI/SQL access to HTTPD Logs SYNOPSIS
use AnyData; my $weblog = adTie( 'Weblog', $filename ); while (my $hit = each %$weblog) { print $hit->{remotehost}," " if $hit->{request} =~ /mypage.html/; } # ... other tied hash operations OR use DBI my $dbh = DBI->connect('dbi:AnyData:'); $dbh->func('hits','Weblog','access_log','ad_catalog'); my $hits = $dbh->selectall_arrayref( qq{ SELECT remotehost FROM hits WHERE request LIKE '%mypage.html%' }); # ... other DBI/SQL read operations DESCRIPTION
This is a plug-in format parser for the AnyData and DBD::AnyData modules. You can gain read access to Common Log Format files web server log files (e.g. NCSA or Apache) either through tied hashes or arrays or through SQL database queries. Fieldnames are taken from the W3 definitions found at http://www.w3.org/Daemon/User/Config/Logging.html#common-logfile-format remotehost usernname authuser date request status bytes In addition, two extra fields that may be present in extended format logfiles are: referer client This module does not currently support writing to weblog files. Please refer to the documentation for AnyData.pm and DBD::AnyData.pm for further details. AUTHOR &; COPYRIGHT copyright 2000, Jeff Zucker <jeff@vpservices.com> all rights reserved perl v5.10.1 2004-08-17 AnyData::Format::Weblog(3pm)
All times are GMT -4. The time now is 10:19 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy