Sponsored Content
Top Forums Shell Programming and Scripting Fine Tune - Huge files/directory - Purging Post 302529351 by senthil.ak on Thursday 9th of June 2011 06:18:35 AM
Old 06-09-2011
@mirni/vidhyadhar
Since I'm combining the find commands by mtime(now its came only 7 mtime) so the removal list wont come big and I am reomving that each and every time. Also if I use the xargs at last is it fine?
Code:
 
find ${PD} -type f \( -name '*(WEEK)*' -o -name '*(MON)*' -o -name '*(TUE)*' \
    -o -name '*(WED)*' -o -name '*(THU)*' -o -name '*(FRI)*' -o -name '*(SAT)*' \
    -o -name '*(SUN)*' -o -name '*(WEEKLY)*' \) -mtime +14 -print | xargs rm

Also I'm runing the script where the mount is physicaly mounted.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Purging a Set of Files

Hi Frineds, I want to delete a set of files which are older than 7 days from teh current date.I am totally enw to shell scripting, can anyone help me with a sample code to list out the files which are older and then remove them from the directory. Please help THanks Viswa (5 Replies)
Discussion started by: svishh123
5 Replies

2. Shell Programming and Scripting

Error While Purging Files

find /filearchive/ -type f -mtime +7 -exec rm weblogs*.log {} \; This worked only if this comand is executed int he unix comand prompt, but when i put this in the shell script it is not recognizing the file.It says weblogs: No such file or directory Am i doing anything wrong here ? (4 Replies)
Discussion started by: svishh123
4 Replies

3. Shell Programming and Scripting

Best way to diff two huge directory trees

Hi I have a job that will be running nightly incremental backsup of a large directory tree. I did the initial backup, now I want to write a script to verify that all the files were transferred correctly. I did something like this which works in principle on small trees: diff -r -q... (6 Replies)
Discussion started by: same1290
6 Replies

4. Cybersecurity

How to fine Tune and Harden the Linux kernel

Hi, As a a security audit, how can I proceed further with Fine tuning and Hardening the linux kernel... I am not sure with the steps how to proceed further... If i do some thing wrong, then its comes with the Kernel panic error. So, I am afraid, how to do the tuning with the kernel.. (1 Reply)
Discussion started by: gsiva
1 Replies

5. Shell Programming and Scripting

Shell script for purging the 3 days old files

Hi all, I try to write shell script to the below requirement. I have Hard coded the oratab location and take the list of databases from oratab and find out archive log locations for each database, and list more than 3 days old files for each location and purge those. ... (2 Replies)
Discussion started by: mak_boop
2 Replies

6. Shell Programming and Scripting

purging of Files

Hello All, I want to delete the files based on the days. like, Files available under directory /abc want to delete if they are older than 15 days. Files available under directory /pqr want to delete if they are 7 days old and some files under directory /xyz should get deleted if they are... (5 Replies)
Discussion started by: ssachins
5 Replies

7. Programming

SQL : Fine tune Insert by query

i would like to know how can i fine tune the following query since the cost of the query is too high .. insert into temp temp_1 select a,b,c,d from xxxx .. database used is IDS.. (1 Reply)
Discussion started by: expert
1 Replies

8. Shell Programming and Scripting

Fine tune this perl script to add router

Hi, I have this routine that reads a microsoft dhcp.netsh dump. Where it finds optionvalue 3 STRING "0.0.0.0" Replace it with the router IP based on the network !/usr/bin/perl while ( <> ) { if ( /\# NET / ) { $net = $'; $net =~ s///g; } else { s/set optionvalue 3... (1 Reply)
Discussion started by: richsark
1 Replies

9. Shell Programming and Scripting

Disc space issues and purging of files

Hi All, I am looking forward to create a unix shell script to purge the files. The requirement is: 1) Do df -k and check the current space occupied for the /a1 folder. 2) If the space consumed is greater than 90 %, delete all the DEF* files from a subfolder /a1/archive. Example: df... (4 Replies)
Discussion started by: shilpa_acc
4 Replies

10. UNIX for Beginners Questions & Answers

Need help with listing file name and modified date on a huge directory

hi, We have a huge directory that ha 5.1 Million files in it. We are trying to get the file name and modified timestamp of the most recent 3 years from this huge directory for a migration project. However, the ls command (background process) to list the file names and timestamp is running for... (2 Replies)
Discussion started by: subbu
2 Replies
metastore(1)						      General Commands Manual						      metastore(1)

NAME
metastore - stores and restores filesystem metadata SYNOPSIS
metastore ACTION [OPTION...] [PATH...] DESCRIPTION
Stores or restores metadata (owner, group, permissions, xattrs and optionally mtime) for a filesystem tree. This can be used to preserve the metadata in situations where it is usually not stored (git and tar for example) or as a tripwire like mechanism to detect any changes to metadata. Note that e.g. SELinux stores its labels in xattrs so care should be taken when applying stored metadata to make sure that system security is not compromised. ACTIONS
-c, --compare Shows the difference between the stored and real metadata. -s, --save Saves the current metadata to ./.metadata or to the specified file (see --file option below). -a, --apply Attempts to apply the stored metadata to the file system. -h, --help Prints a help message and exits. OPTIONS
-v, --verbose Causes metastore to print more verbose messages. Can be repeated more than once for even more verbosity. -q, --quiet Causes metastore to print less verbose messages. Can be repeated more than once for even less verbosity. -m, --mtime Causes metastore to also take mtime into account for the compare or apply actions. -e, --empty-dirs Also attempts to recreate missing empty directories. May be useful where empty directories are not tracked (e.g. by git or cvs). Only works in combination with the apply option. This is currently an experimental feature. -f <file>, --file <file> Causes the metadata to be saved, read from the specified file rather than ./.metadata. PATHS
If no path is specified, metastore will use the current directory as the basis for the actions. This is the recommended way of executing metastore. Alternatively, one or more paths can be specified and they will each be examined. Later invocations should be made using the exact same paths to ensure that the stored metadata is interpreted correctly. AUTHOR
Written by David Hardeman <david@hardeman.nu> May 2007 metastore(1)
All times are GMT -4. The time now is 06:55 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy