The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Advanced & Expert Users
.
google unix.com



UNIX for Advanced & Expert Users Expert-to-Expert. Learn advanced UNIX, UNIX commands, Linux, Operating Systems, System Administration, Programming, Shell, Shell Scripts, Solaris, Linux, HP-UX, AIX, OS X, BSD.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Transfer files wih directory structure. uxlunatick SCO 11 04-28-2008 03:25 PM
copy files with directory structure adddy UNIX for Dummies Questions & Answers 3 12-11-2006 08:50 AM
Copying a Directory Structure to a new structure jhansrod UNIX for Dummies Questions & Answers 8 07-27-2005 06:24 AM
disk space used for files with in a directory structure. kasala Shell Programming and Scripting 8 01-14-2005 04:26 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 09-11-2006
srmadab srmadab is offline
Registered User
  
 

Join Date: Sep 2006
Posts: 4
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 destination that are older than 5days. Please do let me know ASAP if you have any solution. Thanks in advance.

srmadab
  #2 (permalink)  
Old 09-12-2006
tayyabq8's Avatar
tayyabq8 tayyabq8 is offline Forum Advisor  
Moderator
  
 

Join Date: Nov 2004
Location: Bahrain
Posts: 578
To copy a directory structure checkthis thread.

To find and move files older than specific date, check this thread and modify the script as per your needs.
  #3 (permalink)  
Old 09-12-2006
srmadab srmadab is offline
Registered User
  
 

Join Date: Sep 2006
Posts: 4
Thanks

Thanks very much for the help. Aslo I was asking for deleting from the hirarchy structure if it is more than 5 days old.

srmadab
  #4 (permalink)  
Old 09-12-2006
tayyabq8's Avatar
tayyabq8 tayyabq8 is offline Forum Advisor  
Moderator
  
 

Join Date: Nov 2004
Location: Bahrain
Posts: 578
I don't know what you are trying to do, I think you want something like this:
Code:
find /path -type d -mtime +5 -print | xargs rm -r
But be careful with above command.
  #5 (permalink)  
Old 09-13-2006
srmadab srmadab is offline
Registered User
  
 

Join Date: Sep 2006
Posts: 4
thanks

Thanks very much. This helped a lot.

srmadab
Sponsored Links
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 08:12 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0