Using find -d and copying to the found directories
Hi again All
After posting my first thread just a few eeks ago and having such a great response (Thank You once again ), I thought I'd perhaps ask the experts again. In short I'm trying to achieve a "find" and "copy" where the find needs to find directories:
and the copy needs to place a "master" file to these found "outboxes" below the "master" outbox.
I've tried a few variations of:
OR
These though are not working .. Any ideas how I can effectively copy what's in my "master" outbox to multiple outboxes further down the file tree? Currently I have my script running with absolute paths, but as the folder names between the master outbox and other outboxes can change I'd like to find a clever way of "searching" for outboxes and then copying to them - sound possible?
Another Unix question. How would I copy multiple directories at the same time? Right now I do:
cp -r -f /directory1/ ../backup/directory1/
I do that for each directory one at a time. But there are multiple directories I'd like to copy. So instead of sitting there and doing one at a time, is... (9 Replies)
Can we copy a file to multiple directories using a single command line , i tried with * didnt work for me
cp /tmp/a.kool /tmp/folder/*/keys/
I am tryn to copy a.kool file to all keys folder in /tmp folder. is something i am missing ? (4 Replies)
Hello all,
I'm trying to copy all files within a specified directory to another location based on a find filter of mtime -1 (Solaris OS). The issue that I'm having is that in the destination directory, I want to retain the source directory structure while copying over only the files that have... (4 Replies)
Hi All,
I am Oracle Apps Tech guy, I have a requirement to find 777 permission is there or not for all Folders and Sub-folders
Under APPL_TOP (Folder/directory) with below conditions
i) the directory names should start with xx..... (like xxau,xxcfi,xxcca...etc)
and exclude the directory... (11 Replies)
I want to write a script that copys over a complete folder including the dirs to another
location.
However in the process I want to ignore several filetypse that SHOULD NOT get copied over.
I know Global Ignore is capable of make the copy command ignore one file type, however
I don't know how... (8 Replies)
Hi all,
Using grep command, i want to find the pattern of text in all directories and sub-directories.
e.g: if i want to search for a pattern named "parmeter", i used the command
grep -i "param" ../*
is this correct? (1 Reply)
I have the following that I'd like to do:
1. I have split a file into separate files that I placed into the /tmp directory. These files are named F1 F2 F3 F4.
2. In addition, I have several directories which are alphabetized as dira dirb dirc dird.
3. I'd like to be able to copy F1 F2 F3 F4... (2 Replies)
I have a simple script which copies directory from one place to another and deleting the source .
I am facing a situation when new files gets added when the script has started running. Its resulting in data loss
Please suggest a way to avoid data loss. I googled a lot but most are perl... (11 Replies)
Hi,
I have a requirement where I have to connect to another server and copy directories from one server to another
Directories on the Source server look like below (YYYY-MM-DD- 1 to 23)
drwxr-xr-x 2 test_user dmfmart 422 Sep 1 23:45 2014-09-01-18
drwxr-xr-x 2 test_user dmfmart ... (3 Replies)
guys, i did create a script but its too long, though it function the same.
# cat nightlyscan.sh
#!/usr/ksh
deyt=`date +"%Y-%m-%d"`
for i in `ls -lrt|grep $deyt|awk '{print $9}'`
do
cp -f $i /S1/Sophos/logger/
done
#
but i did not paste it all.
this is the desired. (9 Replies)
Discussion started by: kenshinhimura
9 Replies
LEARN ABOUT DEBIAN
tree::simple::visitor::variabledepthclone
Tree::Simple::Visitor::VariableDepthClone(3pm) User Contributed Perl Documentation Tree::Simple::Visitor::VariableDepthClone(3pm)NAME
Tree::Simple::Visitor::VariableDepthClone - A Visitor for cloning parts of Tree::Simple hierarchy
SYNOPSIS
use Tree::Simple::Visitor::VariableDepthClone;
# create an visitor
my $visitor = Tree::Simple::Visitor::VariableDepthClone->new();
$visitor->setCloneDepth(3);
# pass our visitor to the tree
$tree->accept($visitor);
my $partial_tree = $visitor->getClone();
DESCRIPTION
This visitor will clone
METHODS
new There are no arguments to the constructor the object will be in its default state. You can use the "setNodeFilter" method to customize
its behavior.
includeTrunk ($boolean)
Based upon the value of $boolean, this will tell the visitor to include the trunk of the tree in the traversal as well. This basically
means it will clone the root node as well.
setCloneDepth ($number)
setNodeFilter ($filter_function)
This method accepts a CODE reference as its $filter_function argument and throws an exception if it is not a code reference. This code
reference is used to filter the tree nodes as they are cloned.
visit ($tree)
This is the method that is used by Tree::Simple's "accept" method. It can also be used on its own, it requires the $tree argument to be
a Tree::Simple object (or derived from a Tree::Simple object), and will throw and exception otherwise.
getClone
This method returns the cloned partial tree.
BUGS
None that I am aware of. Of course, if you find a bug, let me know, and I will be sure to fix it.
CODE COVERAGE
See the CODE COVERAGE section in Tree::Simple::VisitorFactory for more inforamtion.
SEE ALSO
These Visitor classes are all subclasses of Tree::Simple::Visitor, which can be found in the Tree::Simple module, you should refer to that
module for more information.
AUTHOR
stevan little, <stevan@iinteractive.com>
COPYRIGHT AND LICENSE
Copyright 2005 by Infinity Interactive, Inc.
<http://www.iinteractive.com>
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
perl v5.10.1 2005-10-24 Tree::Simple::Visitor::VariableDepthClone(3pm)