01-15-2005
Copying multiple directories at the same time using Unix
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 there a way to mass copy directories?
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
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)
Discussion started by: logic0
4 Replies
2. UNIX for Dummies Questions & Answers
I need to copy around 30 directories (each directory include one or more text file(s)) from NT server to Unix server at one go. For doing this what are the privillages i should have in both NT and Unix server.
Please let me know which command i can use in shell prompt.
TIA. (4 Replies)
Discussion started by: jhmr7
4 Replies
3. Shell Programming and Scripting
Hi ,
I 'm trying to check if multiple directories exist on a server, if not create the missing ones and print " creating missing directory.
how to write this in a simple script, I have made my code complex
if ; then
taskStatus="Schema extract directory exists, checking if SQL,Count and... (7 Replies)
Discussion started by: ramky79
7 Replies
4. UNIX for Dummies Questions & Answers
Hi,
Very unfamiliar with unix/linux stuff. Our admin is on vacation so, need help very quickly.
I have directories (eg 40001, 40002, etc) that each have one subdirectory (01).
Each subdir 01 has multiple subdirs (001, 002, 003, etc). They are same in each dir.
I need to keep the top and... (7 Replies)
Discussion started by: kkouraus1
7 Replies
5. Shell Programming and Scripting
Hello all!
I'm looking to list directories and sub-directories of a path, on this forum I found this command:
find $path -type d -exec ls -ld {} \;
The issue I have is that with a simple ls, the list is listed by name, and using -t I get it by time.
How could I list directories and sub... (5 Replies)
Discussion started by: nomadvisuals
5 Replies
6. UNIX for Advanced & Expert Users
A report needs to come some what similar to this
No of elements Stream Batch No Load time
A B C D
A,B,C im able to get quite easily
wc -l /usr/local/intranet/areas/prod/output/SRGW_0?/*/MESSAGE_T.dat
O/P of above command.
A B C ... (1 Reply)
Discussion started by: peckenson
1 Replies
7. UNIX for Dummies Questions & Answers
Hi All Genious,
I want to copy a file name XYZ .In a directory /HOME/dir/IXOS1/dir1
which contain multiple directories named not in pattern want to copy the XYZ in all of the directories available on path /HOME/dir/IXOS1/dir1 .
Thanks in advance . (2 Replies)
Discussion started by: mumakhij
2 Replies
8. UNIX for Dummies Questions & Answers
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)
Discussion started by: arunkesi
3 Replies
9. Shell Programming and Scripting
Hi,
I have multiple files that read:
Asa.txt
Bad.txt
Gnu.txt
And I want to rename them using awk to
Asa_ddmmyytt.txt and so on
...
If there is a single command or more efficient executable please share!
Thanks! (4 Replies)
Discussion started by: Jesshelle David
4 Replies
10. UNIX for Beginners Questions & Answers
How to read multiple files at simultaneously? (1 Reply)
Discussion started by: Priyanka_M
1 Replies
cmsync(1m) cmsync(1m)
NAME
cmsync - Synchronize files or directories on multiple Serviceguard nodes.
SYNOPSIS
cmsync [-rv] [[-n node_name]...] [src_node:]src_file [...]
DESCRIPTION
cmsync copies files and/or directories to multiple Serviceguard nodes.
cmsync is limited in several ways. cmsync is best suited for situations where other remote copy facilities are not available. For a more
full featured tool for copying files between Serviceguard nodes, see ccp(1m) provided by Distributed Systems Administration Utilities.
To use this command, the local user must have the root access role on each of the involved nodes. For more information on Serviceguard
access control policies, see the manual, Managing Serviceguard.
To use the cmsync command without specifying -n options, the local node must be configured into a Serviceguard cluster. If no -n options
are specified, the files will be copied to all available nodes in the cluster.
Paths may be relative to the current working directory or specified absolutely. Copies between two remote hosts are permitted.
If a file or directory already exists on a destination node, the destination node's copy will be overwritten with no prompting.
The cmsync command is not suited for large files or large numbers of files and may result in a heavy load on the command and Serviceguard
daemons. Other tools such as ccp should be considered for these purposes.
Options And Arguments
-r Recursively copy entire directories.
-v Verbose output will be displayed.
-n node_name
Serviceguard node to copy file to. If no -n options are specified, default is to copy to all nodes within the configured clus-
ter.
src_node
Serviceguard node to retrieve the file from. Defaults to the local node.
src_file
Path to source file on src_node.
RETURN VALUE
cmsync returns the following values:
0 Successful completion.
1 Command failed.
EXAMPLES
Copy the local file /etc/hosts to remote nodes node1 and node2
cmsync -n node1 -n node2 /etc/hosts
Distribute the remote file /etc/passwd to all nodes in the cluster.
cmsync node1:/etc/passwd
AUTHOR
cmsync was developed by HP.
SEE ALSO
ccp(1m), cmcp(1m), cmexec(1m), cmdo(1m), cmquerycl(1m), cmviewcl(1m)
Requires Optional Serviceguard Software cmsync(1m)