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
Finding files in subdirectories from one location endl UNIX for Dummies Questions & Answers 2 08-20-2008 04:05 PM
copying files from one location to another based on a list rebornhonest UNIX for Dummies Questions & Answers 4 11-30-2007 03:32 PM
excutable script to copy a file to a different location. nazehcalil UNIX for Dummies Questions & Answers 4 12-21-2006 09:17 AM
Location of users cron files JimJim UNIX for Dummies Questions & Answers 3 01-25-2005 05:51 AM
Location of C files on a Unix Environment HelpMeIAmLost UNIX for Dummies Questions & Answers 2 12-05-2003 03:13 PM

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

Join Date: Nov 2007
Posts: 24
Question copy files from one location to similar location

I need help in forming a script to copy files from one location which has a sub directory structure to another location with similar sub directory structure,

say location 1,

/home/rick/tmp_files/1-12/00-25/

here 1-12 are the number of sub directories under tmp_files and 00-25 are sub directories under each of directory 1-12

i need to copy files older than 30 days to similar location

/home/rick/new_files/1-12/00-25/

Can any one help me with the logic please.

Thanks in Advance
  #2 (permalink)  
Old 09-21-2008
Franklin52 Franklin52 is online now Forum Staff  
Moderator
  
 

Join Date: Feb 2007
Posts: 4,294
One (nice) way to do the job with cpio:

Code:
#!/bin/sh

cd /home/rick/tmp_files

find * -mtime +30 -print | cpio -pvdmu /home/rick/new_files
Regards
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 06:51 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