Sponsored Content
Top Forums Shell Programming and Scripting Script to remove all empty files within the directory structure? Post 302202605 by cat123 on Thursday 5th of June 2008 09:01:49 AM
Old 06-05-2008
cheers guys for the help, im gonna give it a go and I'll let you's know how I do.

Cheers
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

disk space used for files with in a directory structure.

Hello, I am new to shell scripting and would really appreciate if someone could help me with this question. I have a directory structure as follows.. main directory is DATA under which i have different directories names fileserver01, fileserver02 ... till fileserver 15. under each... (8 Replies)
Discussion started by: kasala
8 Replies

2. UNIX for Advanced & Expert Users

MV files from one directory structure(multiple level) to other directory structure

Hi, I am trying to write a script that will move all the files from source directory structure(multiple levels might exist) to destination directory structure. If a sub folder is source doesnot exist in destination then I have to skip and goto next level. I also need to delete the files in... (4 Replies)
Discussion started by: srmadab
4 Replies

3. UNIX for Dummies Questions & Answers

copy files with directory structure

i have a text file as. /database/sp/NTR_Update_Imsi_List.sql /database/sp/NTR_Update_Imsi_Range_List.sql /database/sp/NTR_Vlr_Upload.sql /database/tables/StatsTables.sql /mib/ntr.mib /mib/ntr.v2.mib /scripts/operations/ntr/IMSITracer.ph /scripts/operations/ntr/IMSITracer.pl ... (3 Replies)
Discussion started by: adddy
3 Replies

4. SCO

Transfer files wih directory structure.

I need to transfer software off a SCO OpenServer 5.0.5 server. I can not seem to read this server's tape on my other server since the tape drive (IBM Gen 5 DAT 72GB) will continuosly "eject" this DAT 8 tape. I have been able to 'tarball' most of the smaller directories with success and... (11 Replies)
Discussion started by: uxlunatick
11 Replies

5. Shell Programming and Scripting

remove empty directory

Hi, I need to delete an empty directory in a temp directory except "dir5" (keep everything that is not empty). Plese advise. Here is an example of my directory. /dir/temp/ dir1 - delete if this is empty dir2 - delete if this is empty dir3 - delete if this is empty dir4 - delete if this... (7 Replies)
Discussion started by: sirrtuan
7 Replies

6. Shell Programming and Scripting

Shell script to remove empty files

Hi All, Can anyone please write a shell script to remove the empty files using an if condition. please help me out , urgent thanks (6 Replies)
Discussion started by: muthi_murali
6 Replies

7. Shell Programming and Scripting

Archiving files keeping the same structure directory

Hello Team, We would like to backup a lot of files inside of a structure of directories, four, five or more levels in some Ubuntu, Mac and Solaris systems. For instance: /home/chuck/sales/virgin/rent-quote.pdf /home/chuck/sales/marriott/vacation-quote.pdf... (2 Replies)
Discussion started by: csierra
2 Replies

8. UNIX for Dummies Questions & Answers

Script to remove zip files from a directory

Hi Folks, There is a job which generates a .zip files every day at /usr/app/generated directory , now please advise for the script that will delete this zip files permanently.but while deleting it should make sure that it will not delete the last two days recently generated zip files and this... (1 Reply)
Discussion started by: punpun66
1 Replies

9. Shell Programming and Scripting

Remove empty files in home directory

how to remove empty files tried below command its remove only zero bytes not empty file which is greater then zero byte. for x in * do if then rm $x fi done (8 Replies)
Discussion started by: Kalia
8 Replies
RoPkg::DBCollection(3pm)				User Contributed Perl Documentation				  RoPkg::DBCollection(3pm)

NAME
RoPkg::DBCollection - base class who can be used for collections of database objects VERSION
0.1.3 DESCRIPTION
RoPkg::DBCollection is a class who can be used as a base class for database collection of objects. Is used by RoPkg::Simba::Mirrors ,RoPkg::Simba::Commands and RoPkg::Simba::Excludes. This class should not be used directly in applications but derived. SUBROUTINES
/METHODS new() The class constructor. Accepts a hash with parameters. The parameters who can be passed to new() are: dbo - database object (instance of RoPkg::DB) dbo_method - database method (for use with RoPkg::DB) table - the sql table name where the objects data can be found If you don't specify the dbo and dbo_method parameters, a Param::Missing exception is raised. dbh() returns the database handler (DBI object) used by the class. _count($fields) Returns the number of records who match the fields specified in $fields. This method should be overriden by the child classes. The $fields must me specified in SQL::Abstract format. Please refer to the SQL::Abstract documentation for more details about $fields format. _get($class_name, $fields, $order_by) Returns a array of initialized objects. The values are read from the database. $class_name is the name of the class who's gonna be instan- ciated. When creating the class instance dbo and dbo_method parameters are passed to the new() method. The records from the database must match the $fields parameter and the order is given by $order_by. For more details of these 2 parameters please refer to SQL::Abstract docu- mentation. Exceptions throwed: Param::Missing - when $class_name has not been specified Param::Wrong - when $class_name is not a class name DB::NoResults - when the query returned 0 results SYNOPSIS
package RoPkg::Tester; use strict; use warnings; use Scalar::Util qw(blessed); use RoPkg::Exceptions; use RoPkg::DBCollection; use vars qw(@ISA); @ISA=qw(RoPkg::DBCollection); sub new { my ($class, %opt) = @_; my $self; $self = $class->SUPER::new(%opt); $self->{table} = 'Mirrors'; return $self; } sub Count { my ($self) = @_; if (!blessed($self)) { OutsideClass->throw( error => 'Called outside class instance', pkg_name => 'RoPkg::Tester', ); } return $self->_count(); } sub Get { my ($self, $fields) = @_; if (!blessed($self)) { OutsideClass->throw( error => 'Called outside class instance', pkg_name => 'RoPkg::Tester' ); } return $self->_get('RoPkg::Simba::Mirror'); } 1; sub main { my ($dbc, $dbp); $dbp = new RoPkg::DB(); $dbp->Add( 'dbi:mysql:database=mirrors_db;host=localhost', 'root', '', 'mirrors' ); $dbc = new RoPkg::Tester( dbo => $dbp, dbo_method => 'db_mirrors' ); print $dbc->Count(),$/; my @mirrors = $dbc->Get(); } main(); DIAGNOSTICS
This module comes with tests. To run them, unpack the source and use 'make test' command. PERL CRITIC
This modules is perlcritic level 2 compliant (with 1 exception) CONFIGURATION AND ENVIRONMENT
This module does not use any configuration files or environment variables. However, it is possible that some dependencies to do so. Please read the man page of each dependency to find out more information. DEPENDENCIES
This module use the following modules: *) SQL::Abstract *) DBI *) Scalar::Util *) RoPkg INCOMPATIBILITIES
None known to the author BUGS AND LIMITATIONS
None known to the author SEE ALSO
RoPkg::Exceptions RoPkg::DB RoPkg::DBObject RoPkg::Simba::Mirrors AUTHOR
Subredu Manuel <diablo@iasi.roedu.net> LICENSE AND COPYRIGHT
Copyright (C) 2006 Subredu Manuel. All Rights Reserved. This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. The LICENSE file contains the full text of the license. perl v5.8.8 2006-06-09 RoPkg::DBCollection(3pm)
All times are GMT -4. The time now is 10:32 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy