Sponsored Content
Top Forums UNIX for Dummies Questions & Answers find, mv and create unknown parent & subfolders Post 302215063 by cheeba on Tuesday 15th of July 2008 12:29:16 PM
Old 07-15-2008
find, mv and create unknown parent & subfolders

I searched the forum rather thoroughly but still could not find the answer. Hopefully the solution is right under my nose.

Here what I need to do, move older data to a Archive folder that is 18 months old and older.

I would like to use the following command,

find departmentx/* -mtime 530 -exec mv {} Archive/departmentx/{} \;

of course the problem is, there are some subfolders & parent folders within this search that will need to be created so the files can be moved into them, otherwise I just get errors.

Any Ideas?
thanks in advance
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to create folders/subfolders using shellscript

Hi, Can any one help me how to create folders using shellscript.My requirement is: FolderName: Main/Main1 :Main/Main2 :Main/Main3 underSubFolder : Main1/A :Main1/B :Main1/C underSubfolder: A/A1 ... (2 Replies)
Discussion started by: ram2s2001
2 Replies

2. UNIX for Dummies Questions & Answers

Basic Q: getting list of all files of type within folder & subfolders

A painfully rudimentary UNIX question for somebody. I've been puzzling over this for the last hour but can't find the right command. I'm simply trying to get a list of all files - and their full paths - within a folder & subfolders which have extension .php and .js. That's it! No amount of... (1 Reply)
Discussion started by: AtomicPenguin
1 Replies

3. UNIX for Dummies Questions & Answers

How to find files whose case is unknown

Hello experts, can you kindly tell me how I can look for a file in unix whose name may contain upper or lowercase letters? E.g. If I know the file contains the name netcool but unsure if its NETCOOL or netcool? Thanks :) (3 Replies)
Discussion started by: mitkapadia
3 Replies

4. UNIX for Advanced & Expert Users

find size of folders and its subfolders with the Owner details

HI, I have the following command that shows me the total size of folders and subfolders : du -hs *| sort -n result: 1.0M sandeep 1.4G sandy 1.4M important 1.6M files but I will need to know the size of folders and its subfolders( not size of individual files though)... (5 Replies)
Discussion started by: bsandeep_80
5 Replies

5. Shell Programming and Scripting

full path of a file situated either in parent's dir. or parent's parent dir. so on...

hi experts(novice people can stay away as it is no child's game), i am developing a script which works like recycle bin of windows. the problem i am facing is that when ever i am trying to delete a file which is situated in parent directory or parent's parent directory i am unable to... (1 Reply)
Discussion started by: yahoo!
1 Replies

6. Shell Programming and Scripting

Shell script delete log files from folder & subfolders on space usage

Hi, I am trying to write a shell script to delete logs generate by db when space in the folder reaches 70%. i am getting space values from db, find the files at OS and remove them by using a cron job runs every 5minutes. I have to keep the latest 5 files at any time, my problem is that log files... (3 Replies)
Discussion started by: saha
3 Replies

7. Shell Programming and Scripting

Find & replace --> create a new file

Hi All, I have a unix shell script file as below. My task is a)to replace 248 to 350 and need to create a new file as BW3_350.sh b)to replace 248 to 380 and need to create a new file as BW3_380.sh c)to replace 248 to 320 and need to create a new file as BW3_320.sh there is no... (6 Replies)
Discussion started by: karthi_mrkg
6 Replies

8. Emergency UNIX and Linux Support

Script for deleting orphan ids & unknown gecos

The AIX servers that I am working on have been identified as having orphaned user ids & improper gecos for some user ids. Can someone help me with a script to delete the user ids if the orphaned ids are provided in a text file. The home directory set up for the user ids happen to be the... (1 Reply)
Discussion started by: ggayathri
1 Replies

9. Shell Programming and Scripting

Bulk find in UNIX at unknown dir location

Dear All, I have a file which is having a number my_file.csv 032001031 100509001 203001165 there are many more about 5000. I have a path in unix /my_path/my_loc/DEV/RPD10/CPD25/WFM/RK_WFM/OUT/*/ where i will have a file like CPD25_203001165.pdf CPD25_100509001.pdf... (4 Replies)
Discussion started by: yadavricky
4 Replies

10. UNIX for Beginners Questions & Answers

Find for files within a list of subfolders

Helo Is there a better way to search within a list of subfolders : A_START_PATH="/data_1/data_2" # # dir2, dir3, dir6, ..... dir59 exists # A_LIST="$A_START_PATH/dir1 $A_START_PATH/dir4 $A_START_PATH/dir5" find "$A_LIST" -type f -name"*.txt" Now searching for all files in any subdirs... (2 Replies)
Discussion started by: jcdole
2 Replies
Mail::Box::Identity(3pm)				User Contributed Perl Documentation				  Mail::Box::Identity(3pm)

NAME
Mail::Box::Identity - represents an unopened folder INHERITANCE
Mail::Box::Identity is a User::Identity::Item Mail::Box::Identity is a Mail::Reporter SYNOPSIS
use User::Identity; use Mail::Box::Identity; my $me = User::Identity->new(...); my $mailbox = Mail::Box::Identity->new(...); $me->add(folders => $mailbox); # Simpler use User::Identity; my $me = User::Identity->new(...); my $addr = $me->add(folders => ...); DESCRIPTION
The "Mail::Box::Identity" object contains the description of a single mailbox. The mailboxes are collected by an Mail::Box::Collection object. This corresponds with IMAP's "NoSelect", for instance. Nearly all methods can return undef. METHODS
Constructors Mail::Box::Identity->new([NAME], OPTIONS) -Option --Defined in --Default deleted <false> description User::Identity::Item undef folder_type from parent inferiors 1 location undef log Mail::Reporter 'WARNINGS' manager <from parent> marked undef name User::Identity::Item <required> only_subs <foldertype and name dependent> parent User::Identity::Item undef subf_type <same as parent> trace Mail::Reporter 'WARNINGS' deleted => BOOLEAN The folder is flagged for deletion. This not have any implications yet, because it may still get undeleted. description => STRING folder_type => CLASS inferiors => BOOLEAN Can this folder have children? If not, this is cleared. location => DIRECTORY|FILENAME The location of this folder. Often, only the manager can figure-out where this folder really is. log => LEVEL manager => OBJECT Any Mail::Box::Manager or Mail::Box::Manage::User OBJECT. marked => BOOLEAN|"undef" Whether the folder is flagged for some reason, for instance because new messages have arrived. name => STRING only_subs => BOOLEAN Some folder types can have messages in their toplevel folder, other cannot. That determines the default. See Mail::Box::topFolderWithMessages() parent => OBJECT subf_type => CLASS The type for a subfolder collection, must extend CLASS Mail::Box::Collection. trace => LEVEL Attributes $obj->description() See "Attributes" in User::Identity::Item $obj->folderType() Returns the type of this folder. $obj->fullname([DELIMETER]) Returns the name of the folder, from the toplevel until this one, with the DELIMETER string between each level. DELIMETER default to a forward slash (a "/"). $obj->inferiors([BOOLEAN]) "Inferiors" are "subfolders". When this flag is set, it is permitted to create subfolders. $obj->location([FILENAME|DIRECTORY|undef]) Returns the directory or filename of the folder. If this is not pre-defined, it is computed based on the knowledge about the folder type. Be sure to set the location of the toplevel folder to the folderdir of the user to get this to work. $obj->manager() Returns the manager (usually a Mail::Box::Manage::User which owns the folders. May be undefined, by default from parent. $obj->marked([BOOLEAN|undef]) When something special has happened with the folder, this flag can be set (or cleared). The "undef" status is an "unknown". In the IMAP4 protocol, 0 will result in a "Unmarked", a 1 results in a "Marked", and "undef" in nothing. $obj->name([NEWNAME]) See "Attributes" in User::Identity::Item $obj->onlySubfolders([BOOLEAN]) Than this folder be opened (without trying) or not? The default depends on the folder type, and whether this is the toplevel folder or not. See Mail::Box::topFolderWithMessages() $obj->topfolder() Run up the tree to find the highest level folder. Collections $obj->add(COLLECTION, ROLE) See "Collections" in User::Identity::Item $obj->addCollection(OBJECT | ([TYPE], OPTIONS)) See "Collections" in User::Identity::Item $obj->collection(NAME) See "Collections" in User::Identity::Item $obj->find(COLLECTION, ROLE) See "Collections" in User::Identity::Item $obj->parent([PARENT]) See "Collections" in User::Identity::Item $obj->removeCollection(OBJECT|NAME) See "Collections" in User::Identity::Item $obj->type() Mail::Box::Identity->type() See "Collections" in User::Identity::Item $obj->user() See "Collections" in User::Identity::Item Subfolders $obj->addSubfolder(Mail::Box::Identity|DATA) Add a new folder into the administration. With DATA, a new object will be instantiated first. The identity is returned on success. $obj->folder([[NAME, ...], NAME]) Returns the subfolder's object with NAME or "undef" if it does not exist. When multiple NAMEs are added, those super folders are traverst first. Without any NAME, the current object is returned example: get some folder my $a = $user->folders->folder('b', 'a'); my $name = "a:b:c"; my $delim = ":"; my $f = $user->folders->folder(split $delim, $name); $obj->foreach(CODE) For each of the subfolders found below this point call CODE. This current folder is called first. Be warned that you may find identities with the Mail::Box::Identity subroutine deleted flag on. $obj->open(OPTIONS) Open the folder which is described by this identity. Returned is some Mail::Box. The options are passed to Mail::Box::Manager::open(). $obj->remove([NAME]) Remove the folder (plus subfolders) with the NAME. Without NAME, this "Mail::Box::Identity" itself is removed. The removed structure is returned, which is "undef" if not found. This is only an administrative remove, you still need a Mail::Box::Manager::delete(). $obj->rename(FOLDER, [NEWSUBNAME]) Move the folder to a different super-FOLDER, under a NEW SUBfolder NAME. example: renaming a folder my $top = $user->topfolder; my $new = $top->folder('xyz') or die; my $f = $top->folder('abc', 'def')->rename($new, '123'); print $f->name; # 123 print $f->fullname; # =/xyz/123 $obj->subfolderNames() Convenience method: returns the names of the collected subfolders. $obj->subfolders() Returns the subfolders or "undef" if there are none. This information is lazy evaluated and cached. In LIST context, the folder objects are returned (Mail::Box::Identity objects), in SCALAR context the collection, the Mail::Box::Collection. Error handling $obj->AUTOLOAD() See "Error handling" in Mail::Reporter $obj->addReport(OBJECT) See "Error handling" in Mail::Reporter $obj->defaultTrace([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK]) Mail::Box::Identity->defaultTrace([LEVEL]|[LOGLEVEL, TRACELEVEL]|[LEVEL, CALLBACK]) See "Error handling" in Mail::Reporter $obj->errors() See "Error handling" in Mail::Reporter $obj->log([LEVEL [,STRINGS]]) Mail::Box::Identity->log([LEVEL [,STRINGS]]) See "Error handling" in Mail::Reporter $obj->logPriority(LEVEL) Mail::Box::Identity->logPriority(LEVEL) See "Error handling" in Mail::Reporter $obj->logSettings() See "Error handling" in Mail::Reporter $obj->notImplemented() See "Error handling" in Mail::Reporter $obj->report([LEVEL]) See "Error handling" in Mail::Reporter $obj->reportAll([LEVEL]) See "Error handling" in Mail::Reporter $obj->trace([LEVEL]) See "Error handling" in Mail::Reporter $obj->warnings() See "Error handling" in Mail::Reporter Cleanup $obj->DESTROY() See "Cleanup" in Mail::Reporter $obj->inGlobalDestruction() See "Cleanup" in Mail::Reporter DIAGNOSTICS
Error: $object is not a collection. The first argument is an object, but not of a class which extends User::Identity::Collection. Error: Cannot load collection module for $type ($class). Either the specified $type does not exist, or that module named $class returns compilation errors. If the type as specified in the warning is not the name of a package, you specified a nickname which was not defined. Maybe you forgot the 'require' the package which defines the nickname. Error: Creation of a collection via $class failed. The $class did compile, but it was not possible to create an object of that class using the options you specified. Error: Don't know what type of collection you want to add. If you add a collection, it must either by a collection object or a list of options which can be used to create a collection object. In the latter case, the type of collection must be specified. Error: It is not permitted to add subfolders to $name The inferiors() flag prohibits the creation of subfolders to this folder. Warning: No collection $name The collection with $name does not exist and can not be created. Error: Package $package does not implement $method. Fatal error: the specific package (or one of its superclasses) does not implement this method where it should. This message means that some other related classes do implement this method however the class at hand does not. Probably you should investigate this and probably inform the author of the package. Error: The toplevel folder cannot be removed this way The Mail::Box::Identity folder administration structure requires a top directory. That top is registered somewhere (for instance by a Mail::Box::Manage::User). If you need to remove the top, you have to look for a method of that object. Error: Toplevel directory requires explicit folder type Error: Toplevel directory requires explicit location SEE ALSO
This module is part of Mail-Box distribution version 2.105, built on May 07, 2012. Website: http://perl.overmeer.net/mailbox/ LICENSE
Copyrights 2001-2012 by [Mark Overmeer]. For other contributors see ChangeLog. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See http://www.perl.com/perl/misc/Artistic.html perl v5.14.2 2012-05-07 Mail::Box::Identity(3pm)
All times are GMT -4. The time now is 03:08 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy