Sponsored Content
Top Forums Shell Programming and Scripting moving files and creating a link to it Post 302364744 by rpraharaj84 on Friday 23rd of October 2009 07:39:50 PM
Old 10-23-2009
moving files and creating a link to it

Hi All,

I am in a tricky situation where I have to move my files to a different mount point and create a link in place of the file which will point to the moved location.

to explain you in details:-

say I have two mount points

/dir/mount1/
/dir/mount2/

I have my application files in /dir/mount1/application/

in /dir/mount1/application/ i have directories like

/dir/mount1/application/month
/dir/mount1/application/month/day
/dir/mount1/application/month/day/hour
/dir/mount1/application/month/day/hour/min1/a.txt
/dir/mount1/application/month/day/hour/min1/b.txt
/dir/mount1/application/month/day/hour/min1/c.txt

and

/dir/mount1/application/month/day/hour/min2/d.txt
/dir/mount1/application/month/day/hour/min2/e.txt

like wise....these files will be created in day-hour-min format directories...
now I need to move these .txt files to
/dir/mount2/application/ directory which will have exact directory structure which mount point 1 has.

and in place of original files in mount1 I will create softlinks which will be linked to the shifted files respectively....


any idea will be appreciated.... Smilie

---------- Post updated 10-24-09 at 12:39 AM ---------- Previous update was 10-23-09 at 11:18 PM ----------

any luck with any one?
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Creating a link

Hi All, Suppose i have a directory called /home/rooh and I have an executable that writes to this directory. the size of /home/rooh/logs is quite small and thus blows out of space. I don't want to modify the executable but I want to create a link so that all the logs are moved there . ... (1 Reply)
Discussion started by: rooh
1 Replies

2. Shell Programming and Scripting

Creating symbolic link

Any idea how to create a symbolic link...for example i want to create a symbolink link for a specific user in his profile to use the df command...? Thanks in advance (9 Replies)
Discussion started by: charbel
9 Replies

3. UNIX for Dummies Questions & Answers

creating link to new vim

Hi, I have installed vim 7 but I'm unsure how to point the 'vim' command to the new vim version rather than version 6. Thanks in advance. Michael (2 Replies)
Discussion started by: c19h28O2
2 Replies

4. Shell Programming and Scripting

Bash and Awk for creating directories and moving files

I have a security system that FTPs the camera files to my machine, however I want to sort the pictures (taken every 30s) into directories by hour. Every picture uses the following file format. yymmddhhmmsstt.jpg (where tt is the milliseconds) I am thinking the for loop is best for file... (11 Replies)
Discussion started by: Kiint
11 Replies

5. Shell Programming and Scripting

Creating date directory and moving files into that directory

I have list of files named file_username_051208_025233.log. Here 051208 is the date and 025233 is the time.I have to run thousands of files daily.I want to put all the files depending on the date of running into a date directory.Suppose if we run files today they should put into 05:Dec:08... (3 Replies)
Discussion started by: ravi030
3 Replies

6. Solaris

creating link for a file of remote server

Hi, I use to access a file on remote server. Can I create a link for this file present on remote server on my local server, if yes then please let me know. Thanx in advance. (7 Replies)
Discussion started by: sanjay1979
7 Replies

7. UNIX for Dummies Questions & Answers

Odd while Creating Symbolic Link

Hi, # mkdir usr3 # ls -l /h/uxossolbld10/0/teamcity/agent total 8 drwxrwxr-x 14 test1 rdl 512 Nov 30 02:54 conf drwxrwxr-x 3 test1 rdl 512 Jun 24 14:21 scripts drwxrwxr-x 10 test1 rdl 512 Jun 3 2011 teamcity drwxrwxr-x 4 test1 ... (1 Reply)
Discussion started by: Divakar
1 Replies

8. Shell Programming and Scripting

Creating hard link with name

How can I create a hard link to a file, then rename the hard link to a different name? (2 Replies)
Discussion started by: fhill2
2 Replies

9. Shell Programming and Scripting

Archiving and moving files into directories, creating directories, etc.

how can i move "dataName".sql.gz into a folder called 'database' and then move "$fileName".tar.gz * .htaccess into a folder called 'www' with the entire gzipped file being "$fileName".tar.gz? Is this doable or overly complex. so mydemo--2015-03-23-1500.tar.gz > database -... (5 Replies)
Discussion started by: wyclef
5 Replies

10. Shell Programming and Scripting

Moving the target of a symbolic link

Hello all, On a Solaris box, I am trying to move the target of a symbolic link. Let's say the symbolic link looks like the following: /dir1/dir2/link -> /some/dir/target I would like to know of a simple way to move the target of the symbolic link and not the link itself. I'd like to move... (4 Replies)
Discussion started by: ejianu
4 Replies
Time::CTime(3pm)					User Contributed Perl Documentation					  Time::CTime(3pm)

NAME
Time::CTime -- format times ala POSIX asctime SYNOPSIS
use Time::CTime print ctime(time); print asctime(localtime(time)); print strftime(template, localtime(time)); strftime conversions %% PERCENT %a day of the week abbr %A day of the week %b month abbr %B month %c ctime format: Sat Nov 19 21:05:57 1994 %d DD %D MM/DD/YY %e numeric day of the month %f floating point seconds (milliseconds): .314 %F floating point seconds (microseconds): .314159 %h month abbr %H hour, 24 hour clock, leading 0's) %I hour, 12 hour clock, leading 0's) %j day of the year %k hour %l hour, 12 hour clock %m month number, starting with 1, leading 0's %M minute, leading 0's %n NEWLINE %o ornate day of month -- "1st", "2nd", "25th", etc. %p AM or PM %r time format: 09:05:57 PM %R time format: 21:05 %S seconds, leading 0's %t TAB %T time format: 21:05:57 %U week number, Sunday as first day of week %v DD-Mon-Year %w day of the week, numerically, Sunday == 0 %W week number, Monday as first day of week %x date format: 11/19/94 %X time format: 21:05:57 %y year (2 digits) %Y year (4 digits) %Z timezone in ascii. eg: PST DESCRIPTION
This module provides routines to format dates. They correspond to the libc routines. &strftime() supports a pretty good set of coversions -- more than most C libraries. strftime supports a pretty good set of conversions. The POSIX module has very similar functionality. You should consider using it instead if you do not have allergic reactions to system libraries. GENESIS
Written by David Muir Sharnoff <muir@idiom.org>. The starting point for this package was a posting by Paul Foley <paul@ascent.com> LICENSE
Copyright (C) 1996-2010 David Muir Sharnoff. Copyright (C) 2011 Google, Inc. License hereby granted for anyone to use, modify or redistribute this module at their own risk. Please feed useful changes back to cpan@dave.sharnoff.org. perl v5.12.3 2011-05-12 Time::CTime(3pm)
All times are GMT -4. The time now is 02:44 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy