Sponsored Content
Top Forums Shell Programming and Scripting Deleting the files between particular dates Post 302916442 by gull04 on Wednesday 10th of September 2014 04:44:58 AM
Old 09-10-2014
Hi,

Here you would use the find command, below is an example.

Code:
find ./ -mtime +30 -type f -print

The above command will show all files modified 30 days ago or more - use the print statement first to be sure that you find the correct files and do check it's what you want. Then you can run the command again with the delete function added like this;

Code:
find ./ -mtime +30 -type f -exec rm {} \;

You will have to be sure that the list is correct from the first example and the "mtime" value will have to be set to the required vale.

Regards

Dave
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Remove files by dates

I've tried every way possible to remove files by date and nothing seems to work. Does anyone have an idea how to remove files by dates? Thanks in advance.... (1 Reply)
Discussion started by: dman110168
1 Replies

2. UNIX for Dummies Questions & Answers

deleting files with dates 3 months ago

please help me with this????? :confused: :confused: i need to create a program that will run in unix that will delete all files in a given directory that is at least 3 months old. first the program will need to automatically know what date it is right now to determine the files it will... (3 Replies)
Discussion started by: godalle
3 Replies

3. UNIX for Dummies Questions & Answers

Files and dates

Hello all. I am trying to do a file listing on a particular directory by date. I need to list the files and their directories that have a timestamp between Dec-1-2006 and Jan-1-2007. Any help would be greatly appreciated. (1 Reply)
Discussion started by: mastachef
1 Replies

4. UNIX for Dummies Questions & Answers

files between any two given dates

Can any one help me in getting all the files between any two given dates.. (8 Replies)
Discussion started by: thanuman
8 Replies

5. UNIX for Dummies Questions & Answers

Deleting the files comparing the creation dates

Hi Gurus, I am new to unix. I have a requirement where i need to delete some files in a folder twice a week. Suppose i have a folder AAA. In that i have files from 01/04/2008 to 10/04/2008 I want to remove all the files except last 3 days i.e., 10,9th & 8th. Every week twice we want to... (2 Replies)
Discussion started by: pssandeep
2 Replies

6. Shell Programming and Scripting

AIX system.... deleting files in remote directory after retrieving files

Hi Friends, I am new to this , I am working on AIX system and my scenario is to retrive the files from remote system and remove the files from the remote system after retreving files. I can able to retrieve the files but Can't remove files in remote system. Please check my code and help me out... (3 Replies)
Discussion started by: vinayparakala
3 Replies

7. AIX

Copy files for particular dates

Hi, I need to copy particular date files from one directory to another. For example, I have thousands of files in /home/usr From this I need to copy only particular date files (each date contains thousand number of files) to some directory of another server. Could anyone please help me... (3 Replies)
Discussion started by: teddy2882
3 Replies

8. UNIX for Advanced & Expert Users

Find all files other than first two files dates & last file date for month

Hi All, I need to find all files other than first two files dates & last file date for month and month/year wise list. lets say there are following files in directory Mar 19 2012 c.txt Mar 19 2012 cc.txt Mar 21 2012 d.txt Mar 22 2012 f.txt Mar 24 2012 h.txt Mar 25 2012 w.txt Feb 12... (16 Replies)
Discussion started by: Makarand Dodmis
16 Replies

9. Shell Programming and Scripting

Files between two dates in UNIX

Hi Team, I need to connect to a prod server and need to get the files which falls between two dates. I should not create ant files on that machine. I am using korn shell. Your help is very much appreciated. Vinay (13 Replies)
Discussion started by: gvkumar25
13 Replies

10. UNIX for Dummies Questions & Answers

Need to Move files of different dates

Hi, Currently I'm moving the files based on date like below. "mv *20150901* backup_folder" - Limitation: can move only 1 day files to backup folder. I want to move the files of different dates like 20150901,02, 03, 04..... Is there any single command to do it. Thanks in advance!! (2 Replies)
Discussion started by: prakashs1218
2 Replies
ipsec_config_delete(1M) 												   ipsec_config_delete(1M)

NAME
ipsec_config_delete - delete configuration records from the HP-UX IPSec configuration database and delete certificate files SYNOPSIS
object_name ip_addr object_name object_name object_name object_name DESCRIPTION
The command deletes configuration records from the configuration database and certificate data. If HP-UX IPSec is active and running, the data (IPsec policy, authentication record or bypass list entry) is also deleted from the runtime policy database. If you delete IPsec policies that have active Security Associations (SAs), HP-UX IPSec removes the SAs from the Security Association Database (SADB) and sends a delete notification to the remote system. If HP-UX IPSec removes an IKE policy, the associated IPSec SAs can remain active, but no IKE control messages can be sent. The command deletes the certificate for the local system and the related private key file from the directory. It does not delete certifi- cates for CAs or Certificate Revocation Lists (CRLs). To delete these objects, you must manually delete the files in the directory. You can use the command to display the file names with the subject names for the CA certificate files and the issuer names for the CRL files. You cannot delete the configuration object. Options and Operands The command recognizes the following options and operands: object_name Specifies the name of the object you are deleting. Do not use this argument when deleting a configuration object. You cannot delete the host, IKEv1, or IKEv2 policies. ip_addr Specifies the IP address of the entry in the bypass list you are deleting. EXAMPLES
The following command deletes the host IPsec policy named AUTHOR
was developed by HP. FILES
configuration database. default profile file. SEE ALSO
ipsec_admin(1M), ipsec_config(1M), ipsec_config_add(1M), ipsec_config_batch(1M), ipsec_config_export(1M), ipsec_config_show(1M), ipsec_migrate(1M), ipsec_policy(1M), ipsec_report(1M). HP-UX IPSec Software Required ipsec_config_delete(1M)
All times are GMT -4. The time now is 03:49 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy