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 OSF1
log
log(8) System Manager's Manual log(8)NAME
log - Records input and output from a program
SYNOPSIS
/usr/sbin/log <logfile> <command>
OPERANDS
The file in which to record the interaction being logged. The command to execute.
DESCRIPTION
The log program runs <command> and logs the input to and output from <command> to the <logfile> file. Input and output are logged until
<command> exits, the log program exits, and the exit status of <command> is returned.
The log program is used by the system installation procedure and the it(8) command to create the /var/adm/smlogs/install.log and
/var/adm/smlogs/it.log installation log files.
RESTRICTIONS
Because the log program is used in the installation standalone environment, program size was the greatest concern in its implementation.
The log program does not search for the PATH variable to locate <command> and error messages are terse.
The log program causes <command> to take standard input from and write standard output and standard error to UNIX pipes. Some commands
will not be able to operate in this environment; therefore, it is suggested that you use the script(1) command instead. UNIX shells will
not issue prompts when run from log unless the shell is started with an explicit interactive switch (-i for most shells). For example, log
foo.tmp /sbin/sh -i
In the previous example, foo.tmp is the name of <logfile>.
The log program intercepts end-of-file (usually Ctrl/d). Therefore programs which normally receive end-of-file as an exit command must
exit by some other means.
ERRORS
Log open error
Explanation:
The log program was unable to open <logfile>. Verify that the directory exists and that ownerships and permissions are set correctly.
Exec Error
Explanation:
The log program was unable to execute <command>. Verify that you specified a full pathname for <command> and that <command> is an exe-
cutable file.
Fork Error
Explanation:
The log program was unable to create one of the processes it requires to log data.
SEE ALSO
Commands: it(8), script(1)log(8)