script for purge


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting script for purge
# 1  
Old 07-11-2008
script for purge

Hi ,

I want to purge 7 days older data from a list of data sorted on date in a log file...

Can anyone provide me with the shell script for the same..

Thanks,

Jaz
# 2  
Old 07-11-2008
Tools take a look at the find command

man find to learn more.
essentailly, you will have something like
find * -date +7 -exec blah-blah

Wondering if some class somewhere suddenly has an assignment to find files by date. This is the 3rd question related to finding files in the past 24 hours. Search this forum for more help on "find". If you get stuck with final syntax, then supply it in a follow-up posting.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Menu for Purge

I have these commands that help me find and delete files over certain days. How can I build a menu to list the files, and then hit y for yes to delete or no? find /logs/212/abinitio/prod/mfs/partitions/part0/mfs_12way_001/mfs_12way/sncrpt/main/ -name "*dat" -mtime +1 -exec ls -ltr {} \; find... (3 Replies)
Discussion started by: xgringo
3 Replies

2. Emergency UNIX and Linux Support

Purge in oracle9i

From morning we are facing some issues in tablespaces in oracle9i. Tried deleting some huge records... but even thought it is still giving tablespcases in full. Then i tried and googling ... found we need to purge recyclebin of oracle.. but thats not woking in oracle9i... can any one... (1 Reply)
Discussion started by: greenworld123
1 Replies

3. Shell Programming and Scripting

To create a script and schedule which purge 30 days old files

Hi Friends, Very new in Unix and i got a requirement like writing a script and schedule it, so that it removes 30 days old files from all the log locations of a unix box. Suppose i have a unix server ltbamdev1 and in this server i have a mount point opt/bam. In this mount point i have 3... (1 Reply)
Discussion started by: duos
1 Replies

4. UNIX for Advanced & Expert Users

Purge MAil file

Hi, merry christmas. on AIX 6.1, the file /var/spool/mail/user, should/can be purged manually ? Any commande line to purge it ? Thanks. (2 Replies)
Discussion started by: big123456
2 Replies

5. Shell Programming and Scripting

Need a script or one-liner to purge lines from a file.

i all. This one sounds so simple, but I can't get it to work. I need to delete lines with certain keywords from a file. I have a file called defaultRules, with keywords: IPSEC_AH IKE_UDP IPMP_TEST_IFACE2 Then, I have another file called rules.txt with some rules: ... (10 Replies)
Discussion started by: BRH
10 Replies

6. Shell Programming and Scripting

<AIX>Problem in purge script, taking very very long time to complete 18.30hrs

Hi, I have here a script which is used to purge older files/directories based on defined purge period. The script consists of 45 find commands, where each command will need to traverse through more than a million directories. Therefore a single find command executes around 22-25 mins... (7 Replies)
Discussion started by: sravicha
7 Replies

7. Shell Programming and Scripting

Shell script to check the files hourly and purge

I'm new to shell scripting... i have been given a task.. can any one help in this regard.... 1) Check hourly for files in <destination-path><destination-file-template><destination-file-suffix> for files older than <destination-file-retention> days and purge. It should then check... (1 Reply)
Discussion started by: satishpabba
1 Replies

8. Shell Programming and Scripting

script to archive and purge

Hi, I am writing a shell script for archive data from a table. The design is as follows. Step 1: Execute the select query and extract the data into a text file. Step 2: The primary key for this table is TRACKING_NUM, TRACKING_NUM_SUFFIX, TIMESTAMP_UPDATED. So These three fields will be read... (1 Reply)
Discussion started by: kmanivan82
1 Replies

9. Shell Programming and Scripting

shell script for archive purge

I am writing a shell script for Archive Purge for the table having rows < 1 year. The shell script has to extract the rows from the table and write those extracted rows to a text file. Then from the text file, each rows will be read and deleted by means of delete query one by one. The fields will... (5 Replies)
Discussion started by: regnumber
5 Replies

10. UNIX for Dummies Questions & Answers

purge xterm

Being new I had my focus in the wrong place and typed in xterm instead of <If you can't guess, good>. Can I purge xterm so that this word no longer appears using up or down arrows? (1 Reply)
Discussion started by: noobie_doo
1 Replies
Login or Register to Ask a Question