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 > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
way to copy only changed files zuessh AIX 3 12-15-2006 03:41 PM
chmod command for recently modified files polka_friend UNIX for Dummies Questions & Answers 2 08-30-2006 03:25 PM
How to compare two flat files and get changed data jtshashidhar Shell Programming and Scripting 3 01-29-2006 10:26 PM
shortcut for recently used commands in csh RishiPahuja UNIX for Dummies Questions & Answers 1 04-20-2005 04:01 AM
Recently Announced TCP Vulnerability Perderabo News, Links, Events and Announcements 0 04-23-2004 07:38 AM

 
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 01-19-2007
scotbuff scotbuff is offline
Registered User
  
 

Join Date: Jun 2005
Location: Middletown, PA
Posts: 73
Trying to Copy Files Changed Recently

I have been toying around with a script that will copy all files altered in a development directory over to a testing directory and have been trying to construct the command to meet my needs.

Basically I am using find in a directory to see what files have changed over the past 24 hours. Then if I find any files that have changed I want to copy it over to another directory maintaining permissions. I have been toying with both these commands.

cd /home/common-dev
find . -mtime -1 |xargs cp -p {} ../common

I am getting errors about files not being directories so i must have something off with my cp command or how I am understanding how xargs is passing the filename.

cd /home/common-dev
find . -mtime -1 | cpio -opmvd ../common

The cpio command is not retaining permissions but it is doing the copies great.

Any suggestions or enlightenment would be appreciated. Thanks in advance.
 

Bookmarks

Tags
cpio

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:18 PM.


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