Sponsored Content
Top Forums Shell Programming and Scripting Problem in copy files to a folder Post 302594298 by itkamaraj on Tuesday 31st of January 2012 03:09:48 AM
Old 01-31-2012
Code:
find /tmp/Agent/ -type f | while read file; do cp $file /apps/opt/Agent/TEST/; done

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to copy one folder to another with existing files

For example, /tmp/folder1 includes /tmp/folder1/a /tmp/folder1/b /tmp/folder2 includes /tmp/c Is there a command without removing files in /tmp/folder2 first to copy the /tmp/folder1 to /tmp/folder2? and the result should be /tmp/folder2 will include only /tmp/folder2/a... (2 Replies)
Discussion started by: lalelle
2 Replies

2. UNIX for Advanced & Expert Users

Auto copy for files from folder to folder upon instant writing

Hello all, I'm trying to accomplish that if a file gets written to folder /path/to/a/ it gets automatically copied into /path/to/b/ the moment its get written. I thought of writing a shell script and cron it that every X amount of minutes it copies these files over but this will not help me... (2 Replies)
Discussion started by: Bashar
2 Replies

3. Shell Programming and Scripting

Find all text files in folder and then copy to a new folder

Hi all, *I use Uwin and Cygwin emulator. I´m trying to search for all text files in the current folder (C/Files) and its sub folders using find -depth -name "*.txt" The above command worked for me, but now I would like to copy all found text files to a new folder (C/Files/Text) with ... (4 Replies)
Discussion started by: cgkmal
4 Replies

4. Shell Programming and Scripting

Copy files from folder and rename them

hello, I need to build a shell script that receives the folder to copy by parameter and copy all files except thumb.db to another folder and rename them like, file.jpg renamed to file_bb1.jpg. can someone help me Thanks (4 Replies)
Discussion started by: zeker
4 Replies

5. Shell Programming and Scripting

copy all files with the same filenames as those in another folder

Hi, all: I've got two folders, folder A contains some image files (say, 100 files) in .jpg format; folder B contains all description files (say, 500 files) in .txt format. All image files in folder A are able to find their corresponding description files in folder B. That is to say,... (3 Replies)
Discussion started by: jiapei100
3 Replies

6. Shell Programming and Scripting

Copy all zipped files from one folder to another

Hi everyone, when I try to copy *.gz files run cp within the correct source folder it works as follow: Source folder = C:/Documents and Settings/user/Recent papers/2771/ Destination folder = C:/Documents and Settings/user/My documents/1532/temp cp *.gz "C:/Documents and Settings/user/My... (2 Replies)
Discussion started by: cgkmal
2 Replies

7. UNIX for Dummies Questions & Answers

Copy files from unknown sub-folder

Hi, I want to copy files from a unknown sub-folder to other sub-folder without copying the sub-folder. I tried the command: find . -name Results*.pdf | cp *.* /home/dario/Desktop/ but i always copy the subfolder. Can anybody help? (5 Replies)
Discussion started by: limadario
5 Replies

8. UNIX for Dummies Questions & Answers

How to copy files to one folder?

Hi , I have a file like this, i need to trace its path and copy the files from its path to one folder. I need to replace elib.com,melib.com to F:\.Here i need to copy to a folder called image. Please help http://elib.com/SHC/NLNLHB/020001498.pdf ... (4 Replies)
Discussion started by: umapearl
4 Replies

9. UNIX for Dummies Questions & Answers

Copy files to folder.

Hi, I have a folder which contains some files like this. bin.000001 bin.000002 bin.000003 bin.000004 bin.000005 bin.000129 bin.index I want to copy all these files to a new folder except the last files. Please provide some ideas. Please use next time code tags for your code... (6 Replies)
Discussion started by: arijitsaha
6 Replies

10. Shell Programming and Scripting

How to copy files with the same filenames as those in another folder to that same folder?

Hello All A similar question like this was asked before but I need to change part of the question. I've two folders, Folder A contains some image files in 150 subfolders; Folder B contains text files in 350 subfolders. All image files in Folder A have the same filename as the text... (5 Replies)
Discussion started by: chlade
5 Replies
Agent::Channel::File(3pm)				User Contributed Perl Documentation				 Agent::Channel::File(3pm)

NAME
Log::Agent::Channel::File - file logging channel for Log::Agent SYNOPSIS
require Log::Agent::Channel::File; my $driver = Log::Agent::Channel::File->make( -prefix => "prefix", -stampfmt => "own", -showpid => 1, -magic_open => 0, -filename => "/tmp/output.err", -fileperm => 0640, -share => 1, ); DESCRIPTION
The file channel performs logging to a file, along with the necessary prefixing and stamping of the messages. Internally, the "Log::Agent::Driver::File" driver creates such objects for each logging channel defined at driver creation time. The creation routine make() takes the following arguments: "-filename" => file The file name where output should go. The file is opened in append mode and autoflushing is turned on. See also the "-magic_open" flag. "-fileperm" => perm The permissions that the file should be opened with (XOR'd with the user's umask). Due to the nature of the underlying open() and sysopen(), the value is limited to less than or equal to 0666. See "umask" in perlfunc(3) for more details. "-magic_open" => flag When true, channel filenames beginning with '>' or '|' are opened using Perl's open(). Otherwise, sysopen() is used, in append mode. Default is false. "-no_newline" => flag When set to true, never append any " " (on Unix) or " " (on Windows) to log messages. Internally, Log::Agent relies on the channel to delimit logged lines appropriately, so this flag is not used. However, it might be useful for "Log::Agent::Logger" users. Default is false, meaning newline markers are systematically appended. "-no_prefixing" => flag When set to true, disable the prefixing logic entirely, i.e. the following options are ignored completely: "-prefix", "-showpid", "-no_ucfirst", "-stampfmt". Default is false. "-no_ucfirst" => flag When set to true, don't upper-case the first letter of the log message entry when there's no prefix inserted before the logged line. When there is a prefix, a ":" character follows, and therefore the leading letter of the message should not be upper-cased anyway. Default is false, meaning uppercasing is performed. "-prefix" => prefix The application prefix string to prepend to messages. "-rotate" => object This sets a default logfile rotation policy. You need to install the additional "Log::Agent::Rotate" module to use this switch. object is the "Log::Agent::Rotate" instance describing the rotating policy for the channel. Only files which are not opened via a so- called magic open can be rotated. "-share" => flag When true, this flag records the channel in a global pool indexed by filenames. An existing file handle for the same filename may be then be shared amongst several file channels. However, you will get this message in the file Rotation for 'filename' may be wrong (shared with distinct policies) when a rotation policy different from the one used during the initial opening is given. Which policy will be used is unspecified, on purpose. "-showpid" => flag If set to true, the PID of the process will be appended within square brackets after the prefix, to all messages. Default is false. "-stampfmt" => (name | CODE) Specifies the time stamp format to use. By default, my "own" format is used. See Log::Agent::Stamping for a description of the available format names. You may also specify a CODE ref: that routine will be called every time we need to compute a time stamp. It should not expect any parameter, and should return a string. CAVEAT
Beware of chdir(). If your program uses chdir(), you should always specify logfiles by using absolute paths, otherwise you run the risk of having your relative paths become invalid: there is no anchoring done at the time you specify them. This is especially true when configured for rotation, since the logfiles are recreated as needed and you might end up with many logfiles scattered throughout all the directories you chdir()ed to. AUTHORS
Originally written by Raphael Manfredi <Raphael_Manfredi@pobox.com>, currently maintained by Mark Rogaski <mrogaski@cpan.org>. LICENSE
Copyright (C) 1999 Raphael Manfredi. Copyright (C) 2002 Mark Rogaski, mrogaski@cpan.org; all rights reserved. See Log::Agent(3) or the README file included with the distribution for license information. SEE ALSO
Log::Agent::Logger(3), Log::Agent::Channel(3). perl v5.10.0 2002-03-09 Agent::Channel::File(3pm)
All times are GMT -4. The time now is 06:26 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy