The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Advanced & Expert Users
Google UNIX.COM


UNIX for Advanced & Expert Users Advanced UNIX and Linux questions go here. Expert-to-Expert.

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 12:25 PM
copy files with directory structure adddy UNIX for Dummies Questions & Answers 3 12-11-2006 04:50 AM
Copying a Directory Structure to a new structure jhansrod UNIX for Dummies Questions & Answers 8 07-27-2005 03:24 AM
disk space used for files with in a directory structure. kasala Shell Programming and Scripting 8 01-14-2005 12:26 PM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 09-11-2006
Registered User
 

Join Date: Sep 2006
Posts: 4
Stumble this Post!
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
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 09-11-2006
tayyabq8's Avatar
UNIX Hobbyist
 

Join Date: Nov 2004
Location: /World/Asia/MiddleEast/Kuwait/Salmiya
Posts: 523
Stumble this Post!
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.
Reply With Quote
  #3 (permalink)  
Old 09-12-2006
Registered User
 

Join Date: Sep 2006
Posts: 4
Stumble this Post!
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
Reply With Quote
  #4 (permalink)  
Old 09-12-2006
tayyabq8's Avatar
UNIX Hobbyist
 

Join Date: Nov 2004
Location: /World/Asia/MiddleEast/Kuwait/Salmiya
Posts: 523
Stumble this Post!
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.
Reply With Quote
  #5 (permalink)  
Old 09-13-2006
Registered User
 

Join Date: Sep 2006
Posts: 4
Stumble this Post!
thanks

Thanks very much. This helped a lot.

srmadab
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 08:52 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0