Sponsored Content
Top Forums Shell Programming and Scripting copy directory structure to a system on the network Post 302246884 by ShawnMilo on Tuesday 14th of October 2008 03:55:21 PM
Old 10-14-2008
A cheap way to do it is to use the output of find to create a bunch of mkdir statements.

Code:
 find . -type d

The output of this (from the directory you want to start in) will print the directory tree, and no files. Throw a "mkdir " at the beginning of each line and I think you'd be set.

Code:
 find . -type d | perl -ne 'print "mkdir " . $_'  > make_tree.sh
bash make_tree.sh #on the new system

 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

any idea to copy directory structure

I want to copy the durectory structure having subdirectories in it ... would be greatful if anyone could let me know .. thanks in advance (6 Replies)
Discussion started by: myelvis
6 Replies

2. 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

3. UNIX for Advanced & Expert Users

MV files from one directory structure(multiple level) to other directory structure

Hi, I am trying to write a script that will move all the files from source directory structure(multiple levels might exist) to destination directory structure. If a sub folder is source doesnot exist in destination then I have to skip and goto next level. I also need to delete the files in... (4 Replies)
Discussion started by: srmadab
4 Replies

4. UNIX for Dummies Questions & Answers

copy files with directory structure

i have a text file as. /database/sp/NTR_Update_Imsi_List.sql /database/sp/NTR_Update_Imsi_Range_List.sql /database/sp/NTR_Vlr_Upload.sql /database/tables/StatsTables.sql /mib/ntr.mib /mib/ntr.v2.mib /scripts/operations/ntr/IMSITracer.ph /scripts/operations/ntr/IMSITracer.pl ... (3 Replies)
Discussion started by: adddy
3 Replies

5. Shell Programming and Scripting

Recursion to Copy a Directory structure

I have the below code to recurse through a given file path. I am able to go to the leaf level once recursively but traversing out is not possible as the required varaibles don't have the values on return. Both typeset and local don't work for my variable definitions. I have the o/p of the sample... (2 Replies)
Discussion started by: avrkiran
2 Replies

6. UNIX for Dummies Questions & Answers

Linux Server Network Settings - Share Directory Structure

Hello Unix Gurus Who I Hope Reads This, I have quasi-inherited control over a Linux cluster at a university research lab. The post-doc that set it up is gone, and the person in charge of administering the cluster doesn't know a ton about Linux. Amongst other things, I want to use the cluster... (0 Replies)
Discussion started by: mbl
0 Replies

7. Shell Programming and Scripting

Copy only folder structure ?

Hello, I am not sure how feasible is it, but trying to copy/create the folders from one box to another. I dont want to copy the content of folder otherwise it'd be too much of data.. The folder structure is quite complex (in deep hierarchy) and its a big effort manually .. Please... (5 Replies)
Discussion started by: navsha
5 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. Programming

Deep copy of structure in C

Hi , I have a scenario where i need to copy the iter to another local variable , where iter is of type MCC_T_SYS_ADDRINFO *iter . struct addrinfo { int ai_flags; int ai_family; int ai_socktype; int ai_protocol; ... (5 Replies)
Discussion started by: breezevinay
5 Replies
SYSTEMD-NETWORKD.SERVICE(8)				     systemd-networkd.service				       SYSTEMD-NETWORKD.SERVICE(8)

NAME
systemd-networkd.service, systemd-networkd - Network manager SYNOPSIS
systemd-networkd.service /lib/systemd/systemd-networkd DESCRIPTION
systemd-networkd is a system service that manages networks. It detects and configures network devices as they appear, as well as creating virtual network devices. To configure low-level link settings independently of networks, see systemd.link(5). systemd-networkd will create network devices based on the configuration in systemd.netdev(5) files, respecting the [Match] sections in those files. systemd-networkd will manage network addresses and routes for any link for which it finds a .network file with an appropriate [Match] section, see systemd.network(5). For those links, it will flush existing network addresses and routes when bringing up the device. Any links not matched by one of the .network files will be ignored. It is also possible to explicitly tell systemd-networkd to ignore a link by using Unmanaged=yes option, see systemd.network(5). When systemd-networkd exits, it generally leaves existing network devices and configuration intact. This makes it possible to transition from the initrams and to restart the service without breaking connectivity. This also means that when configuration is updated and systemd-networkd is restarted, netdev interfaces for which configuration was removed will not be dropped, and may need to be cleaned up manually. CONFIGURATION FILES
The configuration files are read from the files located in the system network directory /lib/systemd/network, the volatile runtime network directory /run/systemd/network and the local administration network directory /etc/systemd/network. Networks are configured in .network files, see systemd.network(5), and virtual network devices are configured in .netdev files, see systemd.netdev(5). SEE ALSO
systemd(1), systemd.link(5), systemd.network(5), systemd.netdev(5), systemd-networkd-wait-online.service(8) systemd 237 SYSTEMD-NETWORKD.SERVICE(8)
All times are GMT -4. The time now is 09:50 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy