Recursively move directories along with files/specific files
I would like to transfer all files ending with .log from /tmp and to /tmp/archive (using find )
The directory structure looks like :-
When I tried the following command , it movies all the log files to /tmp/archive (does not maintain the directory structure ) The output is
whereas the output should be
For copying (cp) ,this can be done using -R but does not work with move (mv) .Is there any simple command to achieve this .
I had gone through forums and come across few commands rsync ,tar ......
Also , could anyone explain the difference between cp and rsync
What is the usage of the command tar?
Last edited by Franklin52; 05-24-2011 at 12:52 PM..
Reason: Please use code tags
Hi
I am a shell-script newbie and am looking to synchronize certain files in two directory structures.
Both these directory-trees are in CVS and so I dont want the CVS directory to be copied over.
I want only .sh and .pl files in each subdirectory under these directory trees to be... (3 Replies)
Hello, this is probably another really simple tasks for most of you gurus, however I am trying to make a script which takes an input, greps a specific file for that input, prints back to screen the results (which are directory names) and then be able to use the directory names to move files.... (1 Reply)
Hi,
I have various log files in different paths. e.g.
a/b/c/d/e/server.log
a/b/c/d/f/server.log
a/b/c/d/g/server.log
a/b/c/h/e/server.log
a/b/c/h/f/server.log
a/b/c/h/g/server.log
a/b/c/i/e/server.log
a/b/c/i/e/server.log
a/b/c/i/e/server.log
and above these have an archive folder... (6 Replies)
Hi,
Please help me, how to get all the direcotries, its sub directories and its sub directories recursively, need to exclude all the files in the process.
I wanted to disply using a unix command all the directories recursively excluding files.
I tried 'ls -FR' but that display files as... (3 Replies)
Hi,
Seems like I need help again with a problem:
I want to delete all files from my lets say "Music" Directory inkluding all of the subfolders
except for .mp3 and .MP3 files.
I tried it with globalignoring mp3 files, finding and deleting all other files, which
resulted in all files... (3 Replies)
Hi,
In a parent directory there are several files in the form
IDENTIFIER1x
IDENTIFIER1.yyy
IDENTIFIER1_Z, etc
IDENTIFIER2x
IDENTIFIER2.yyy
IDENTIFIER2_Z, etc
IDENTIFIER3x
IDENTIFIER3.yyy,
IDENTIFIER3_Z, etcIn the same parent directory there are corresponding directories named... (7 Replies)
Hi.
I found many scripts in the web of achieving this.
But I like to use this one
find /EDWH-DMT03 -xdev -size +10000 -exec ls -la {} \;|sort -n -k 5 > LARGE.rst
But the problem is, why it still list out files with 89 bytes as the output? Is there anything wrong with the command?
My... (7 Replies)
Is it possible to only copy selected files+its directories when you are copying recursively?
find /OriginalFolder/* -type -d \{ -mtime 1 -o -mtime 2 \ } -exec cp -R {} /CopyTo/'hostname'__CopyTo/ \; -print
From the above line, I want to only copy *txt and *ini files from /OriginalFolder/*
... (4 Replies)
Hello,
I'm a first time poster looking for help in scripting a task in my daily routine. I am new in unix but i am attracted to its use as a mac user.
Bear with me...
I have several files (20) that I manually drag via the mouse into several named directories over a network. I've used rsync... (14 Replies)
Discussion started by: SonnyClark
14 Replies
LEARN ABOUT CENTOS
pmfetcharchive
PMFETCHARCHIVE(3) Library Functions Manual PMFETCHARCHIVE(3)NAME
pmFetchArchive - get performance metrics directly from an archive log
C SYNOPSIS
#include <pcp/pmapi.h>
int pmFetchArchive(pmResult **result);
cc ... -lpcp
DESCRIPTION
pmFetchArchive is a variant of pmFetch(3) that may only be used when the current Performance Metrics Application Programming Interface
(PMAPI) context is associated with an archive log.
The result is instantiated with all of the metrics (and instances) from the next archive record, consequently there is no notion of a list
of desired metrics, and the instance profile of the PMAPI context is ignored.
It is expected that pmFetchArchive would be used to create utilities that scan archive logs, while the more common access to the archives
would be via the pmFetch(3) interface.
To skip records within the archive log, use pmSetMode(3) to change the collection time within the current PMAPI context, then call
pmFetchArchive.
Note that the result returned by pmFetchArchive is dynamically allocated, and must be released using pmFreeResult(3), not free(3C). See
pmFetch(3) and pmFreeResult(3) for further details.
pmFetchArchive returns zero on success.
SEE ALSO PMAPI(3), pmFetch(3), pmFreeResult(3), pmNewContext(3), pmSetMode(3) and pmTrimNameSpace(3).
DIAGNOSTICS
PM_ERR_NOTARCHIVE
the current PMAPI context is not associated with an archive log
Performance Co-Pilot PCP PMFETCHARCHIVE(3)