Sponsored Content
Top Forums Shell Programming and Scripting Fine Tune - Huge files/directory - Purging Post 302529339 by vidyadhar85 on Thursday 9th of June 2011 05:49:44 AM
Old 06-09-2011
I would still go with option 1. However if the list of files to be removed is very large then you might get an error thats bevause it might go beyond the string which can be handled by the rm command.

-exec won't create any problem. Its as good as runing rm command.
This User Gave Thanks to vidyadhar85 For This Post:
 

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
DH_INSTALL(1)							     Debhelper							     DH_INSTALL(1)

NAME
       dh_install - install files into package build directories

SYNOPSIS
       dh_install [-Xitem] [--autodest] [--sourcedir=dir] [debhelperoptions] [file|dir...destdir]

DESCRIPTION
       dh_install is a debhelper program that handles installing files into package build directories. There are many dh_install* commands that
       handle installing specific types of files such as documentation, examples, man pages, and so on, and they should be used when possible as
       they often have extra intelligence for those particular tasks. dh_install, then, is useful for installing everything else, for which no
       particular intelligence is needed. It is a replacement for the old dh_movefiles command.

       This program may be used in one of two ways. If you just have a file or two that the upstream Makefile does not install for you, you can
       run dh_install on them to move them into place. On the other hand, maybe you have a large package that builds multiple binary packages. You
       can use the upstream Makefile to install it all into debian/tmp, and then use dh_install to copy directories and files from there into the
       proper package build directories.

       From debhelper compatibility level 7 on, dh_install will fall back to looking in debian/tmp for files, if it does not find them in the
       current directory (or wherever you've told it to look using --sourcedir).

FILES
       debian/package.install
	   List the files to install into each package and the directory they should be installed to. The format is a set of lines, where each
	   line lists a file or files to install, and at the end of the line tells the directory it should be installed in. The name of the files
	   (or directories) to install should be given relative to the current directory, while the installation directory is given relative to
	   the package build directory. You may use wildcards in the names of the files to install.

	   Note that if you list exactly one filename or wildcard-pattern on a line by itself, with no explicit destination, then dh_install will
	   automatically guess the destination to use, the same as if the --autodest option were used.

       debian/not-installed
	   Used with the deprecated --list-missing and --fail-missing options.	Please refer to dh_missing(1) for the documentation of this file.

OPTIONS
       --list-missing
	   Deprecated: Please use dh_missing --list-missing instead.  If you use this option, dh_install will call dh_missing with that option
	   after it has processed all the files.  Please see dh_missing(1) for the documentation of this option.

	   This option is removed in compat 12.

       --fail-missing
	   Deprecated: Please use dh_missing --fail-missing instead.  If you use this option, dh_install will call dh_missing with that option
	   after it has processed all the files.  Please see dh_missing(1) for the documentation of this option.

	   This option is removed in compat 12.

       --sourcedir=dir
	   Look in the specified directory for files to be installed.

	   Note that this is not the same as the --sourcedirectory option used by the dh_auto_* commands. You rarely need to use this option,
	   since dh_install automatically looks for files in debian/tmp in debhelper compatibility level 7 and above.

       --autodest
	   Guess as the destination directory to install things to. If this is specified, you should not list destination directories in
	   debian/package.install files or on the command line. Instead, dh_install will guess as follows:

	   Strip off debian/tmp (or the sourcedir if one is given) from the front of the filename, if it is present, and install into the dirname
	   of the filename. So if the filename is debian/tmp/usr/bin, then that directory will be copied to debian/package/usr/. If the filename
	   is debian/tmp/etc/passwd, it will be copied to debian/package/etc/.

       file|dir ... destdir
	   Lists files (or directories) to install and where to install them to.  The files will be installed into the first package dh_install
	   acts on.

LIMITATIONS
       dh_install cannot rename files or directories, it can only install them with the names they already have into wherever you want in the
       package build tree.

       However, renaming can be achieved by using dh-exec with compatibility level 9 or later.	An example debian/package.install file using dh-
       exec could look like:

	#!/usr/bin/dh-exec
	debian/default.conf => /etc/my-package/start.conf

       Please remember the following three things:

       o   The package must be using compatibility level 9 or later (see debhelper(7))

       o   The package will need a build-dependency on dh-exec.

       o   The install file must be marked as executable.

SEE ALSO
       debhelper(7)

       This program is a part of debhelper.

AUTHOR
       Joey Hess <joeyh@debian.org>

11.1.6ubuntu2							    2018-05-10							     DH_INSTALL(1)
All times are GMT -4. The time now is 09:36 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy