Automatically creating a folder


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Automatically creating a folder
# 1  
Old 08-03-2006
Automatically creating a folder

Hi

How can i create a date folder inside my logs folder everday when a script is run ??

eg : ./logs/20060803/pkm.log

where only variable is 20060803 and all other folder name should remain same.

Thanks in advance

Pankaj
# 2  
Old 08-03-2006
Code:
mkdir ./logs/$(date +%Y%m%d)

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Creating dated folder name in SMB share

I can't seen to figure this out. Let's say I want to create a folder with the name "August2017". In regular terminal prompt I can type mkdir `date +%B%Y` But when I'm connected to a SMB share (at the smb: prompt), the command doesn't translate properly. A folder gets created but the name is... (4 Replies)
Discussion started by: sdch1000
4 Replies

2. Shell Programming and Scripting

Bash to select oldest folder in directory automatically and log process

The `bash` below uses the oldest folder in the specified directory and logs it. The goes though an analysis process and creates a log. My problem is that if there are 3 folders in the directory folder1,folder2,folder3, the bash is using folder2 for the analysis eventhough folder1 is the oldest... (0 Replies)
Discussion started by: cmccabe
0 Replies

3. Shell Programming and Scripting

Creating a ksh script to copy a folder

Hi Folks, I need help in creating a ksh script to copy a folder from one server to multiple other servers using ssh and sftp. The thing is the folder name changes daily. So is there a way we could specify the folder name during the execution of script.? I would appreciate a quicker help.... (3 Replies)
Discussion started by: lena07
3 Replies

4. UNIX for Dummies Questions & Answers

Creating a sub-folder in multiple folders

Hi I've been trying to find an answer to this question and was hoping someone would be able to help me. I want to add a sub-folder to to an existing structure: for example /toys/toy_1/new /toys/toy_2/new /toys/toy_3/new There are humdreds of theses folders - what i want to do is add a... (2 Replies)
Discussion started by: LouSan
2 Replies

5. OS X (Apple)

Creating a hidden partition that doesn't mount automatically

I have a drive full of diagnostic images (ASD), and I also use it for storage, installers, etc. When I plug it in to a booted system, it has to mount every single volume (about 25) which can take some time. I would like to keep all the ASD partitions from mounting when plugged in/at boot. I know... (0 Replies)
Discussion started by: nextyoyoma
0 Replies

6. Shell Programming and Scripting

Copy files by automatically creating directories

I am in a situation where I have some hundreds of thousands of files in a directory (name of directory: big_directory). Now, working on this directory is extremely slow. I now plan to do this: Copy 1000 files in each of the directories by creating the directories automatically. All files have... (1 Reply)
Discussion started by: shoaibjameel123
1 Replies

7. UNIX for Advanced & Expert Users

Set ACL automatically for new folder/objects

Hi, In our bank production environment - IBM AIX 5.3, we have a particular parent folder inside which an application creates temporary folders & files. These temp folders exist for the lifetime of the user session within the application and then get deleted automatically. Since these temp... (1 Reply)
Discussion started by: deepaksinbox
1 Replies

8. Shell Programming and Scripting

Using cp: preserving file/folder attributes and auto creating folders

Hi, Is there a way to use cp in such a way that when a file is copied to a destination, the required destination folders are automatically created with the proper permissions, and the resulting copied file has the same attributes as the original. For example if I copied... (1 Reply)
Discussion started by: pcwiz
1 Replies

9. UNIX for Dummies Questions & Answers

Creating space in root folder

Hi , I was wondering if anyone knows any great ways for creating space in your Root Folder. My root folder was created with only 247.7MB & I found out that its now full & I was initially wondering how important the "thumbnails Folder" was & if it was alright to delete their contenses as I noticed... (2 Replies)
Discussion started by: Browser
2 Replies

10. Shell Programming and Scripting

creating folder when the string matches

hi :confused:sorry last time , b4 im drafting the thread i was unexpectedly posted the thread see here is the program wat it will do is .. i have to create folder at the run time when the string matches ... what to do is im havin text file which carry the file name like ( EngCVer1pg1j01.TOP,... (2 Replies)
Discussion started by: maximas
2 Replies
Login or Register to Ask a Question