Sponsored Content
Top Forums Shell Programming and Scripting Copy Directory Tree from one Server to Another Post 302937399 by mohtashims on Thursday 5th of March 2015 10:44:01 AM
Old 03-05-2015
Error

Quote:
Originally Posted by jim mcnamara
You want empty directories on serverB.

Code:
echo 'mkdir /opt/app/myfiles' > mkdirs.shl
find  /opt/app/myfiles -type d |
while read rec
do
  echo "mkdir $rec"
done >> mkdirs.shl
chmod +mkdirs.shl
scp mkdirs.shl serverB:
ssh serverB './mkdirs.shl'

You see this works but it takes more than an hour for the find command as it is affected by the thousands of files which are present in the folder. Any better fix ?
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Read from fileList.txt, copy files from directory tree

Hi, hopefully this is a fairly simple Q&A. I have a clean file list of approximately 180 filenames with no directory or slashes in front of the filename nor any extension or dot ".". I would like to read from this list, find these files recursively down through directory trees, copy the files... (1 Reply)
Discussion started by: fxvisions
1 Replies

2. Shell Programming and Scripting

Recursively copy only specific files from a directory tree

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)
Discussion started by: sharpsharkrocks
3 Replies

3. UNIX for Dummies Questions & Answers

Move all files in a directory tree to a signal directory?

Is this possible? Let me know If I need specify further on what I am trying to do- I just want to spare you the boring details of my personal file management. Thanks in advance- Brian- (2 Replies)
Discussion started by: briandanielz
2 Replies

4. Shell Programming and Scripting

copy the latest file in the remote server's directory

Hi Expert Team, I performed the below piece of code to copy the latest file in the remote server's directory to the same server's other directory. But it is not working properly. How can i handle this? Can you please help me..? ssh ${REMOTE_USERID}@${REMOTE_HOSTNAME} "cp -p `ssh... (3 Replies)
Discussion started by: spkandy
3 Replies

5. Shell Programming and Scripting

Copy a directory from a server (UNIX) to a PC (Windows)

Hello, I already do some question about this topic. I already establish the conection from the server (Centus) whit the windows PC using SSH. Now I have two problems: 1- The server always ask me about a password to copy the files to the windows pc, I don't know how to avoid this, if someone can... (2 Replies)
Discussion started by: yeestrada
2 Replies

6. UNIX for Dummies Questions & Answers

How to copy a tree of directory

Mi question is how can you copy only de three of directory and not the files in it. Only a need the three of directorys not the files (6 Replies)
Discussion started by: enkei17
6 Replies

7. UNIX for Dummies Questions & Answers

Copy directory tree with files

Iam in the process of copying a directory with thousands of directories and files into a new directory. I need to preserve permissions, owner, group, date and timestamps, everything. Iam using AIX and would need help of writing the command whether it is cp-RP or cpio. Apprecaite your... (3 Replies)
Discussion started by: baanprog
3 Replies

8. Shell Programming and Scripting

Need to copy a directory structure from one server to another

Hello All, I have got a dev server and a production server will call it as D server and P server. I have a dir structure in my D server and i need to create the same dir structure in P server also using a shell script. If i do a find . in my D server, i am getting an o/p like :- . ./vio... (9 Replies)
Discussion started by: Renjesh
9 Replies

9. Shell Programming and Scripting

Specific directory parsing in a directory tree

Hi friends, Hello again :) i got stuck in problem. Is there any way to get a special directory from directory tree? Here is my problm.." Suppose i have one fix directory structure "/abc/xyz/pqr/"(this will be fix).Under this directory structure i have some other directory and... (6 Replies)
Discussion started by: harpal singh
6 Replies

10. Shell Programming and Scripting

Copy real file from a shortcut preserving the time stamps and directory tree

I have directory with shorcuts of files. for example: gara@yn\short\name1 ( shortcut to gara@yn\FOLDER\OPT\GARA\1.jpg ) gara@yn\short\name2 ( shortcut to gara@yn\FOLDER\OPT\GARA\11.jpg ) gara@yn\short\name3 ( shortcut to gara@yn\MARA\URSA\2.jpg ) gara@yn\short\name4 ( shortcut to... (6 Replies)
Discussion started by: gogok_bg
6 Replies
shl(1)							      General Commands Manual							    shl(1)

NAME
shl - shell layer manager SYNOPSIS
DESCRIPTION
provides a means for interacting with more than one shell from a single terminal by using shell layers. A layer is a shell that is bound to a virtual device. The virtual device can be manipulated like an actual terminal by using and (see stty(1) and ioctl(2)). Each layer has its own process group ID. The user controls these layers by using the commands described below. The current layer is the layer that can receive input from the keyboard. Other layers attempting to read from the keyboard are blocked. Output from multiple layers is multiplexed onto the terminal. To block the output of a layer when it is not current, the option can be set within the layer. The character (set to if NUL) is used to switch control to from a layer. has its own prompt, to distinguish it from a layer. Definitions A is a sequence of characters delimited by a space, tab, or new-line character. Only the first eight characters are significant. When provided as an argument to the or commands, name cannot be of the form n or where n is a decimal number. Commands The following commands can be issued from the prompt level. Any unique prefix is accepted. Create a layer called name and make it the current layer. If no argument is given, a layer is created with a name of the form where n is the num- ber of the next available slot in an internal table. Future references to this layer can be made with or without the paren- theses. If name is followed by a command, that command is executed in the layer instead of a shell. If is the first argu- ment, a ``login shell'' is created in the layer. The shell prompt variable is set to the name of the layer followed by a space. Rename the layer oldname, calling it newname. If oldname is not specified, the current layer name is changed. Invoke a sub-shell and execute command. If no command is given, a shell is executed according to the environment variable. For each name, block the output of the corresponding layer when it is not the current layer. This is equivalent to setting the option within the layer. For each name, delete the corresponding layer. All processes in the process group of the layer are sent the signal (see signal(5)). Print the syntax of the commands. For each name, list the layer name and its process group. The option produces a ps(1)-like listing. If no arguments are given, information is presented for all existing layers. Change the status of the layer referred to by name to that of current layer. If no argument is given, the last existing current layer is changed. Change the status of the previous current layer to that of current layer. For each name, do not block the output of the corresponding layer when it is not the current layer. This is equivalent to setting the option within the layer. Exit All layers are sent the signal. name Change the status of the layer referred to by name to that of current layer. Any unique prefix is accepted. WARNINGS
Commands The behavior of the and commands is not guaranteed when the SHELL environment variable is set to (for csh(1)) or (for ksh(1)), or when the shell saves and restores the tty state (defined in termio(7)) before and after each command is invoked interactively from that shell. For both and the or options of can be used from within the layer to block or unblock the output of that layer. Ptydaemon For to function properly, the process must be running on the system. If your system has been installed with the Desktop HP-UX product, then will not be started by default. In order to start this daemon, change from a "0" to a "1" in the file. The system must either be rebooted for this change to take effect, or you can manually start this daemon by typing : Note that will also be disabled if the DesktopConfig.LITECONFIG fileset has been installed on the system, or if the system administrator has previously run the utility and selected the from within any of screens. does not support long user and group names on the current release, HP-UX 11i V3. FILES
Variable containing path name of the shell to use (default is SEE ALSO
sh(1), stty(1), ioctl(2), signal(5). STANDARDS CONFORMANCE
shl(1)
All times are GMT -4. The time now is 02:29 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy