Sponsored Content
Top Forums UNIX for Dummies Questions & Answers copying the dir/subdir structure from one server to another? Post 302652633 by Hangman2 on Thursday 7th of June 2012 11:51:12 AM
Old 06-07-2012
copying the dir/subdir structure from one server to another?

Hi All,
I want to copy the dir/subdir structure from SERVER-A to SERVER-B without copying all the files in each dir.

Is it possible using SCP / SFTP command?

For example,

SERVER-A has following two dir/subdirectories and files under each subdir.
Code:
/main_dir/dir1/subdir1_of_dir1/subdir12_of_dir1/Bunch_of_files****
/main_dir/dir1/subdir2_of_dir1/subdir22_of_dir1/Bunch_of_files****

When I am done issuing this command, following dir/subdir structure should be on SERVER-B but no files should be copied.

SERVER-B
Code:
/main_dir/dir1/subdir1_of_dir1/subdir12_of_dir1/No_Files
/main_dir/dir1/subdir2_of_dir1/subdir22_of_dir1/No_Files

Moderator's Comments:
Mod Comment Please use next time
code tags for your code and data

Last edited by vbe; 06-07-2012 at 12:57 PM..
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Copying a Directory Structure to a new structure

Hi all Is it possible to copy a structure of a directory only. e.g. I have a file with the following entries that is a result of a find :- /dir1/dir2/file.dbf /dir1/dir2/dir3/file1.dbf /dir1/file.dbf I want to copy these to a directory and keep the structure however starting at a new dir... (8 Replies)
Discussion started by: jhansrod
8 Replies

2. Shell Programming and Scripting

copying a file from one dir to another dir

hi i have a script compareFiles() { find /tmp/Satya -type f | \ while read filename1 do echo "----------------------------------------$filename1" find /tmp/Satya -type f | \ while read filename2 do if diff $filename1 $filename2 then echo "Both files... (3 Replies)
Discussion started by: Satyak
3 Replies

3. Shell Programming and Scripting

move files and retain subdir structure

hi: I have some files like this folder1/recording1.mp3 folder1/docs/budget.doc folder2/others/misc.mp3 folder3/others/notes.doc all this folders and files are under the mp3 folder. I would like to move just the mp3s to another folder but retain the subdir structure i have. So if... (4 Replies)
Discussion started by: jason7
4 Replies

4. Shell Programming and Scripting

moving dir subdir and files

I have created a directory structure and under the directory subdirectories and files are there.I need to move the entire thing to another path.How can i write a script to do that. currently the path of files is as below : /data1/serial/mcycle/archive : under this path differnt sub dir exist ... (6 Replies)
Discussion started by: dr46014
6 Replies

5. Shell Programming and Scripting

replace string in multiple files, dir and subdir

Hello, I have a directory www with multiple directories. Every directory has site name with .htm, .html, .php files or sub directories with .htm, .php, .html file as example - www - sitename 1 - site 1 - sitename 2 - sitename 3 What I'm looking for is a... (7 Replies)
Discussion started by: andyjill
7 Replies

6. UNIX for Dummies Questions & Answers

Copying dir (and sub dir) file names from ftp server to txt file in diff server

Hey all, i want to copy only the file names from an ftp server (directory and all sub directory) to a text file in another server (non ftp), i.e. i want to recursively move through directories and copy only the names to a text file. any help is appreciated...thank you in advance (1 Reply)
Discussion started by: deking
1 Replies

7. Shell Programming and Scripting

Perform action in dir if dir has .git subdir

Hi, I want to run git status for the dir which has subdir ".git" in it with dir path mentioned in output log? If a dir does not have .git subdir then skip that dir. Dir will have 100 main dirs & 500 + subdirs and so on. I appreciate all your help :b: (4 Replies)
Discussion started by: dragon.1431
4 Replies

8. Shell Programming and Scripting

Move all files from dir and subdir to Archive with File name as complete path_filename

HI, I need to move all files from a dir & its all subdir to Archive folder which is indise dir only. and moved filename should changed to complete path ( Like Dir_subdir_subdir2_.._filename ). also all files names shoud capture in a file in order to mail I written below code ... (11 Replies)
Discussion started by: minijain7
11 Replies

9. Shell Programming and Scripting

Copying files to new dir structure.

I am trying to figure out a way to script copying specific files from one dir structure to another. I have a dir structure like this: dira/author 1/book 1/file a.epub /book 2/file b.epub /author 2/book 1/file c.epub /author 3/book 1/file d.epub /book 2/file... (2 Replies)
Discussion started by: arcanas
2 Replies

10. UNIX for Dummies Questions & Answers

How do I create a tar file for only dir and its subdir structures??

How do I create a tar file for only dir and its subdir structures?? (4 Replies)
Discussion started by: vx04
4 Replies
ROUNDUP-SERVER(1)					      General Commands Manual						 ROUNDUP-SERVER(1)

NAME
roundup-demo - create a roundup "demo" tracker and launch its web interface SYNOPSIS
roundup-demo [backend [nuke]] OPTIONS
nuke Create a fresh demo tracker (deleting the existing one if any). If the additional backend argument is specified, the new demo tracker will use the backend named (one of "anydbm", "sqlite", "metakit", "mysql" or "postgresql"; subject to availability on your system). DESCRIPTION
This command creates a fresh demo tracker for you to experiment with. The email features of Roundup will be turned off (so the nosy feature won't send email). It does this by removing the nosyreaction.py module from the demo tracker's detectors directory. If you wish, you may modify the demo tracker by editing its configuration files and HTML templates. See the customisation manual for infor- mation about how to do that. Once you've fiddled with the demo tracker, you may use it as a template for creating your real, live tracker. Simply run the roundup-admin command to install the tracker from inside the demo tracker home directory, and it will be listed as an available template for installa- tion. No data will be copied over. AUTHOR
This manpage was written by Richard Jones <richard@users.sourceforge.net>. 27 July 2004 ROUNDUP-SERVER(1)
All times are GMT -4. The time now is 01:21 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy