Sponsored Content
Top Forums Shell Programming and Scripting Automating creation of directories Post 302597509 by zaxxon on Friday 10th of February 2012 01:48:53 PM
Old 02-10-2012
Check the -p-switch of the mkdir-command. Instead of feeding a script in a while/read loop with a directory structure, you could just write the same with this command. Should be the same amount of typing. Is this homework?
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Automating creation of sub-domains???

Edit, Sorry realised that muxtape.com is probably not creating a sub-domain for every accout but more than likely using a wildcard in the apache config and then using php/asp/java or similar to look at the url and point it in the right direction. So youraccount.muxtape.com maps to... (0 Replies)
Discussion started by: elduderino
0 Replies

2. Shell Programming and Scripting

Script for parsing directories one level and finding directories older than n days

Hello all, Here's the deal...I have one directory with many subdirs and files. What I want to find out is who is keeping old files and directories...say files and dirs that they didn't use since a number of n days, only one level under the initial dir. Output to a file. A script for... (5 Replies)
Discussion started by: ejianu
5 Replies

3. Shell Programming and Scripting

Creation of multiple directories

I have a folder structure like the below /test/test1/test2/app /test/test3/app /test/test4/test5/app .. I need to create a new folder under "app" in all the above listed directory structure at one shot by the name "subapp" . How can we acheive this using a script . New to unix... (4 Replies)
Discussion started by: rajeshnatarajan
4 Replies

4. UNIX for Dummies Questions & Answers

List directories with given string, sort by creation date

It is for HP-Unix B.11.31. Requirement: 1. List the directories, which directories name has given particular string. Example: Directories with name "Build" 2. On the output of 1. list the directories by creation date as sort order. I tried with; find . -type d -name "Build*" ... (3 Replies)
Discussion started by: Siva SQL
3 Replies

5. HP-UX

Symbolic link creation between 2 directories on different machines

I am trying to link 2 directories using: ln -s /net/<hostname>/srcdir/ /net/<desthostname>/dstdir/ I get the following error: ln: /net/<desthostname>/dstdir: Function is not available What is it that i am trying to do wrongly in the above operation? Please use next time code tags (3 Replies)
Discussion started by: Amit Kulkarni
3 Replies

6. Shell Programming and Scripting

How to list all the files, directories and sub-directories in the current path except one directory?

Can anyone come up with a unix command that lists all the files, directories and sub-directories in the current directory except a folder called log.? Thank you in advance. (7 Replies)
Discussion started by: Manjunath B
7 Replies

7. UNIX for Dummies Questions & Answers

List the directories, having given pattern in the directories name, sorted by creation date

It is for HP-Unix B.11.31. Requirement: 1. List the directories, having given pattern in the directories name, sorted by creation date. Example: Directories with name "pkg32*" or "pkg33*" 2. On the output of 1. list the directories by creation date as sort order, with creation date... (2 Replies)
Discussion started by: Siva SQL
2 Replies

8. Shell Programming and Scripting

[Solved] Creation of directories

i am having trouble creating a directory with last months date as the folder name. what i am using is echo `date +%b%y` which gives Mar14 as the result but i want to get Feb14 as the result.:wall: (6 Replies)
Discussion started by: simkazw
6 Replies

9. Solaris

Giving read write permission to user for specific directories and sub directories.

I have searched this quite a long time but couldn't find the right method for me to use. I need to assign read write permission to the user for specific directories and it's sub directories and files. I do not want to use ACL. This is for Solaris. Please help. (1 Reply)
Discussion started by: blinkingdan
1 Replies
AFS-UP(1)						       AFS Command Reference							 AFS-UP(1)

NAME
up - Recursively copy directories, preserving AFS metadata SYNOPSIS
up [-v] [-1] [-f] [-r] [-x] [-m] <source directory> <destination directory> DESCRIPTION
The up command recursively copies the files and subdirectories in a specified source directory to a specified destination directory. The command interpreter changes the destination directory and the files and subdirectories in it in the following ways: o It copies the source directory's access control list (ACL) to the destination directory and its subdirectories, overwriting any existing ACLs. o If the issuer is logged on as the local superuser root and has AFS tokens as a member of the group system:administrators, then the source directory's owner (as reported by the "ls -ld" command) becomes the owner of the destination directory and all files and subdirectories in it. Otherwise, the issuer's user name is recorded as the owner. o If a file or directory exists in both the source and destination directories, the source version overwrites the destination version. The overwrite operation fails if the first (user) "w" (write) mode bit is turned off on the version in the destination directory, unless the -f flag is provided. o The modification timestamp on a file (as displayed by the "ls -l" command) in the source directory overwrites the timestamp on a file of the same name in the destination directory, but the timestamp on an existing subdirectory in the destination directory remains unchanged. If the command creates a new subdirectory in the destination directory, the new subdirectory's timestamp is set to the time of the copy operation, rather than to the timestamp that the subdirectory has in the source directory. The up command is idempotent, meaning that if its execution is interrupted by a network, server machine, or process outage, then a subsequent reissue of the same command continues from the interruption point, rather than starting over at the beginning. This saves time and reduces network traffic in comparison to the UNIX commands that provide similar functionality. The up command returns a status code of 0 (zero) only if it succeeds. Otherwise, it returns a status code of 1 (one). This command does not use the syntax conventions of the AFS command suites. Provide the command name and all option names in full. OPTIONS
-v Prints a detailed trace to the standard output stream as the command runs. -1 Copies only the files in the top level source directory to the destination directory, rather than copying recursively through subdirectories. The source directory's ACL still overwrites the destination directory's. (This is the number one, not the letter "l".) -f Overwrites existing directories, subdirectories, and files even if the first (user) "w" (write) mode bit is turned off on the version in the destination directory. -m Recognize and copy mount points rather than traversing the volumes they reference during the recursive copy operation. Without -m, up's default behavior is to copy the contents of all volumes and subvolumes mounted under the source directory into the volume containing the destination directory. -r Creates a backup copy of all files overwritten in the destination directory and its subdirectories, by adding a ".old" extension to each filename. -x Sets the modification timestamp on each file to the time of the copying operation. source directory Names the directory to copy recursively. destination directory Names the directory to which to copy. It does not have to exist already. EXAMPLES
The following command copies the contents of the directory dir1 to directory dir2: % up dir1 dir2 PRIVILEGE REQUIRED
The issuer must have the "a" (administer) permission on the ACL of both the source and destination directories. COPYRIGHT
IBM Corporation 2000. <http://www.ibm.com/> All Rights Reserved. This documentation is covered by the IBM Public License Version 1.0. It was converted from HTML to POD by software written by Chas Williams and Russ Allbery, based on work by Alf Wachsmann and Elizabeth Cassell. OpenAFS 2012-03-26 AFS-UP(1)
All times are GMT -4. The time now is 09:39 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy