Sponsored Content
Operating Systems Solaris Delete files according to date Post 302314277 by ghostdog74 on Friday 8th of May 2009 01:19:13 AM
Old 05-08-2009
if you have Python installed on SUN, here's an alternative
Code:
#!/usr/bin/env python
import time,os
for r,d,f in os.walk("/your/path"):
    for files in f:
        t=os.path.getmtime(os.path.join(r,files))
        if "Mar" in time.ctime(t):
            os.remove(os.path.join(r,files))

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

how to delete files by date

My apache logs are saved in the following format (using rotatelogs): Oct 8 01:59 access_log.1002412800 Oct 9 01:55 access_log.1002499200 Oct 10 01:58 access_log.1002585600 Oct 11 01:56 access_log.1002672000 Oct 12 01:59 access_log.1002758400 I would like to run a cronjob once a week to... (2 Replies)
Discussion started by: jamesbond
2 Replies

2. 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

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
CVSDELTA(1)							  cvsdelta 1.7.0						       CVSDELTA(1)

NAME
cvsdelta - Manage and summarize the differences between a CVS project and local files. SYNOPSIS
cvsdelta [options] [file ...] DESCRIPTION
Manages and summarizes the differences between a CVS project and local files, showing the changes of the files themselves and of their con- tents. Added, changed, and deleted files are denoted with `+', `*', and `-' respectively. The number of lines are displayed. OPTIONS
-a, --adds Display the files that were added. This is done by default. -A, --no-adds Do not display the files that were added. The default is to show the added files. --banner, --no-banner Whether to show the banner, i.e., the header and footer of the output table. By default, the banner is displayed. -c, --changes Display the files that were changed. This is done by default. -C, --no-changes, --nodiff Do not compare files that exist locally and in CVS. This executes significantly faster, and is useful for when one only wants to add and remove files, without getting the summary of the changes. It is also helpful for dealing with situations where CVS seems to hang after producing diff output, although changing the compression level can help with this. The default is to show the changed files. -d, --deletes Display the files that were deleted. This is done by default. -D, --no-deletes Do not display the files that were deleted. The default is to show the files that were deleted. -e, --execute Execute the associated CVS commands ("add" and "remove") for the added and deleted files. -f DATE, --from-date DATE Compare the files to their version as of the given date, rather than their current version in CVS. The date is expected to be in CVS format, for example, 2002/12/31. -F REVISION, --from-revision REVISION Compare the files to their version as of the given revision, rather than their current version in CVS. -h, --help Display a help message. -i, --confirm Interactively confirm deleted files with the user before removing them from CVS. The default is simply to execute the remove command for relevant files. This option is valid only with the --execute option. --progress, --no-progress Whether to show the progress meter as the program is working with CVS. By default, this is not shown. -q, --quiet Run with minimum output. In quiet mode, the progress meter is not displayed. -s, --skip-unknown-directories Skip directories that are not in CVS. The default behavior is to process all subdirectories. -t DATE, --to-date DATE Compare the files to their version as of the given date, rather than to the local files. The date is expected to be in CVS format, for example, 2001/08/21. This option is valid only with the --from-date or --from-revision options. -T REVISION, --to-revision REVISION Compare the files to their version as of the given revision, rather than to the local files. This is valid only with the --from-date or --from-revision options. -v, --version Display the version and exit. -V, --verbose Run with maximum output, which is written to standard error. -z [LEVEL], ---compression [LEVEL] Set the compression to the given level for net traffic. This can be useful if the CVS server seems to hang. The default level is 3; 0 and 9 work well. ARGUMENTS
Arguments may be either files or directories. File If a file is provided, it is compared against the equivalent in CVS, if any. The .cvsignore files are applied, so that although the file was explicitly provided, it may be ignored. Directory Directories are processed recursively for files that are not filtered out by .cvsignore files. EXAMPLES
% cvsdelta Lists the changed files. % cvsdelta --execute Lists the changed files, and executes the associated add and remove commands. % cvsdelta --compression 9 --execute --confirm --no-changes Run with the maximum compression level. Add and remove the appropriate files, but get confirmation from the user before removing any files. Do not compare files that exist both locally and in CVS. ENVIRONMENT
$HOME/.cvsdeltarc, .../project/.cvsdeltarc Resource files containing name/value pairs, separated by either ':' or '='. The valid fields of a .cvsdeltarc file are as follows, with their default values: quiet: false verbose: false execute: false confirm: false diff: true compression: 3 adds: true changes: true deletes: true skip-unknown-directories: false banner: true "yes" and "on" are synonymnous with "true". "no" and "off" signify "false". The values in the project .cvsdeltarc file will override those in the user's .cvsdeltarc file. The project .cvsdeltarc is assumed to be at the topmost directory in the local file hierarchy. CVSDELTAOPTS A string of whitespace-delimited options, the same as listed above. These values override those of the resource files. NOTES
If a file exists in the CVS project but not locally, it is assumed that the file has been deleted, not that it may have been recently added by another user. The --confirm option can be used to deal with this situation. AUTHOR
Jeff Pace <jpace@incava.org> COPYRIGHT
Copyright (c) 2002, Jeff Pace. All Rights Reserved. This module is free software. It may be used, redistributed and/or modified under the terms of the Lesser GNU Public License. See http://www.gnu.org/licenses/lgpl.html for more information. cvsdelta 1.7.0 2004-04-08 CVSDELTA(1)
All times are GMT -4. The time now is 11:04 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy