FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > CentOS > CentOS

 
 
LinkBack Thread Tools
 
Old 06-09-2008, 03:16 PM
"Rajeev R. Veedu"
 
Default Copying files from specific date.

Dear all,


*


Does anyone aware of any utility *to copy files which are
created or modify form a specific date ?.


*


Thanks


*


Rajeev R. Veedu







_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 06-09-2008, 03:30 PM
"Jim Perrin"
 
Default Copying files from specific date.

On Mon, Jun 9, 2008 at 11:16 AM, Rajeev R. Veedu <rajeev@cracknell.com> wrote:
> Dear all,
>
>
>
> Does anyone aware of any utility to copy files which are created or modify
> form a specific date ?.

Use find with either -exec or with xargs, and pass it either a -ctime
or -mtime option for what you need.

for example, find /path/ -type f -mtime -2 -name '*.txt' -exec cp {}
/path/to/copy/to/

this may not be 100% syntactically correct, but should give you the
general idea.


--
During times of universal deceit, telling the truth becomes a revolutionary act.
George Orwell
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 06-09-2008, 03:34 PM
Steve Huff
 
Default Copying files from specific date.

On Jun 9, 2008, at 11:16 AM, Rajeev R. Veedu wrote:
Does anyone aware of any utility to copy files which are created
or modify form a specific date ?.




to copy all files in /dir1 modified within the last 5 days to /dir2:

$ find /dir1 -mtime -5 | xargs -I {} cp {} /dir2

if the filenames have whitespace in them, you can use this trick:

$ find /dir1 -mtime -5 -print0 | xargs -0 -I {} cp {} /dir2

for more details on selecting by time:

$ man find

pay particular attention to the options -atime, -amin, -ctime, -cmin,
-mtime, -mmin, and -daystart.


-steve
--

If this were played upon a stage now, I could condemn it as an
improbable fiction. - Fabian, Twelfth Night, III,v




_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 06-09-2008, 04:21 PM
"Rajeev R. Veedu"
 
Default Copying files from specific date.

-----Original Message-----
From: centos-bounces@centos.org [mailto:centos-bounces@centos.org] On Behalf Of Steve Huff
Sent: Monday, June 09, 2008 7:34 PM
To: centos@centos.org
Subject: Re: [CentOS] Copying files from specific date.


On Jun 9, 2008, at 11:16 AM, Rajeev R. Veedu wrote:
> Does anyone aware of any utility to copy files which are created
> or modify form a specific date ?.
>

>>to copy all files in /dir1 modified within the last 5 days to /dir2:

>>$ find /dir1 -mtime -5 | xargs -I {} cp {} /dir2

>>if the filenames have whitespace in them, you can use this trick:

>>$ find /dir1 -mtime -5 -print0 | xargs -0 -I {} cp {} /dir2

>>for more details on selecting by time:

>>$ man find

>>pay particular attention to the options -atime, -amin, -ctime, -cmin,
>>-mtime, -mmin, and -daystart.

>>-steve
--

Actually I need to copy this on to another server with same folder structure. I think I need to explain bit of history.

I had a server crash last week, and we have restored the files from the tape. However during this period of making the server up, the users having adding or changed files from our backup Server (Samba server which rsync to production server every night.) now I need to copy the files which user added/ modify last 7 days. Ideally if I can get this option in rsync it would be better. Otherwise I need to have a method so that all changed files to go on the relevant folder on the production server. I cannot take the full files in the backup files since they are historical backup and there are some unwanted files.

Can I use scp instead of cp in your statement?. But how does it take the same directory name as the original location?

Eg:from ServerA/FLDR2/FLDR3/Filename should go to ServerB/FLDR2/FLDR3/FILENAME

Only change is the server name all other values will remain same.

Any help would be really appreciated.

Thanks

Rajeev



_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 06-09-2008, 06:48 PM
Bowie Bailey
 
Default Copying files from specific date.

Rajeev R. Veedu wrote:
> -----Original Message-----
> From: centos-bounces@centos.org [mailto:centos-bounces@centos.org] On
> Behalf Of Steve Huff
> Sent: Monday, June 09, 2008 7:34 PM
> To: centos@centos.org
> Subject: Re: [CentOS] Copying files from specific date.
>
>
> On Jun 9, 2008, at 11:16 AM, Rajeev R. Veedu wrote:
> > Does anyone aware of any utility to copy files which are created
> > or modify form a specific date ?.
> >
>
> > > to copy all files in /dir1 modified within the last 5 days to
> > > /dir2:
>
> > > $ find /dir1 -mtime -5 | xargs -I {} cp {} /dir2
>
> > > if the filenames have whitespace in them, you can use this trick:
>
> > > $ find /dir1 -mtime -5 -print0 | xargs -0 -I {} cp {} /dir2
>
> > > for more details on selecting by time:
>
> > > $ man find
>
> > > pay particular attention to the options -atime, -amin, -ctime,
> > > -cmin, -mtime, -mmin, and -daystart.
>
> > > -steve
>
> Actually I need to copy this on to another server with same folder
> structure. I think I need to explain bit of history.
>
> I had a server crash last week, and we have restored the files from
> the tape. However during this period of making the server up, the
> users having adding or changed files from our backup Server (Samba
> server which rsync to production server every night.) now I need to
> copy the files which user added/ modify last 7 days. Ideally if I can
> get this option in rsync it would be better. Otherwise I need to have
> a method so that all changed files to go on the relevant folder on
> the production server. I cannot take the full files in the backup
> files since they are historical backup and there are some unwanted
> files.
>
> Can I use scp instead of cp in your statement?. But how does it take
> the same directory name as the original location?
>
> Eg:from ServerA/FLDR2/FLDR3/Filename should go to
> ServerB/FLDR2/FLDR3/FILENAME
>
> Only change is the server name all other values will remain same.
>
> Any help would be really appreciated.

One approach would be to use the find command given above to generate a
list of files that have changed. Then pass that list to rsync via the
'--files-from' option to transfer them to the other server.

--
Bowie
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 06-10-2008, 12:56 PM
"Peter Farrell"
 
Default Copying files from specific date.

That's an excellent idea.
-pf


2008/6/9 Bowie Bailey <Bowie_Bailey@buc.com>:
> Rajeev R. Veedu wrote:
>> -----Original Message-----
>> From: centos-bounces@centos.org [mailto:centos-bounces@centos.org] On
>> Behalf Of Steve Huff
>> Sent: Monday, June 09, 2008 7:34 PM
>> To: centos@centos.org
>> Subject: Re: [CentOS] Copying files from specific date.
>>
>>
>> On Jun 9, 2008, at 11:16 AM, Rajeev R. Veedu wrote:
>> > Does anyone aware of any utility to copy files which are created
>> > or modify form a specific date ?.
>> >
>>
>> > > to copy all files in /dir1 modified within the last 5 days to
>> > > /dir2:
>>
>> > > $ find /dir1 -mtime -5 | xargs -I {} cp {} /dir2
>>
>> > > if the filenames have whitespace in them, you can use this trick:
>>
>> > > $ find /dir1 -mtime -5 -print0 | xargs -0 -I {} cp {} /dir2
>>
>> > > for more details on selecting by time:
>>
>> > > $ man find
>>
>> > > pay particular attention to the options -atime, -amin, -ctime,
>> > > -cmin, -mtime, -mmin, and -daystart.
>>
>> > > -steve
>>
>> Actually I need to copy this on to another server with same folder
>> structure. I think I need to explain bit of history.
>>
>> I had a server crash last week, and we have restored the files from
>> the tape. However during this period of making the server up, the
>> users having adding or changed files from our backup Server (Samba
>> server which rsync to production server every night.) now I need to
>> copy the files which user added/ modify last 7 days. Ideally if I can
>> get this option in rsync it would be better. Otherwise I need to have
>> a method so that all changed files to go on the relevant folder on
>> the production server. I cannot take the full files in the backup
>> files since they are historical backup and there are some unwanted
>> files.
>>
>> Can I use scp instead of cp in your statement?. But how does it take
>> the same directory name as the original location?
>>
>> Eg:from ServerA/FLDR2/FLDR3/Filename should go to
>> ServerB/FLDR2/FLDR3/FILENAME
>>
>> Only change is the server name all other values will remain same.
>>
>> Any help would be really appreciated.
>
> One approach would be to use the find command given above to generate a
> list of files that have changed. Then pass that list to rsync via the
> '--files-from' option to transfer them to the other server.
>
> --
> Bowie
> _______________________________________________
> CentOS mailing list
> CentOS@centos.org
> http://lists.centos.org/mailman/listinfo/centos
>
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 06-10-2008, 04:50 PM
MHR
 
Default Copying files from specific date.

On Tue, Jun 10, 2008 at 5:56 AM, Peter Farrell
<peter.d.farrell@gmail.com> wrote:
> That's an excellent idea.
> -pf
>

What is?

>
> 2008/6/9 Bowie Bailey <Bowie_Bailey@buc.com>:
>> Rajeev R. Veedu wrote:
>>> -----Original Message-----
>>> From: centos-bounces@centos.org [mailto:centos-bounces@centos.org] On
>>> Behalf Of Steve Huff
>>> Sent: Monday, June 09, 2008 7:34 PM
>>> To: centos@centos.org
>>> Subject: Re: [CentOS] Copying files from specific date.
>>>
>>>
>>> On Jun 9, 2008, at 11:16 AM, Rajeev R. Veedu wrote:
>>> > Does anyone aware of any utility to copy files which are created
>>> > or modify form a specific date ?.
>>> >
>>>
>>> > > to copy all files in /dir1 modified within the last 5 days to
>>> > > /dir2:
>>>
>>> > > $ find /dir1 -mtime -5 | xargs -I {} cp {} /dir2
>>>
>>> > > if the filenames have whitespace in them, you can use this trick:
>>>
>>> > > $ find /dir1 -mtime -5 -print0 | xargs -0 -I {} cp {} /dir2
>>>
>>> > > for more details on selecting by time:
>>>
>>> > > $ man find
>>>
>>> > > pay particular attention to the options -atime, -amin, -ctime,
>>> > > -cmin, -mtime, -mmin, and -daystart.
>>>
>>> > > -steve
>>>
>>> Actually I need to copy this on to another server with same folder
>>> structure. I think I need to explain bit of history.
>>>
>>> I had a server crash last week, and we have restored the files from
>>> the tape. However during this period of making the server up, the
>>> users having adding or changed files from our backup Server (Samba
>>> server which rsync to production server every night.) now I need to
>>> copy the files which user added/ modify last 7 days. Ideally if I can
>>> get this option in rsync it would be better. Otherwise I need to have
>>> a method so that all changed files to go on the relevant folder on
>>> the production server. I cannot take the full files in the backup
>>> files since they are historical backup and there are some unwanted
>>> files.
>>>
>>> Can I use scp instead of cp in your statement?. But how does it take
>>> the same directory name as the original location?
>>>
>>> Eg:from ServerA/FLDR2/FLDR3/Filename should go to
>>> ServerB/FLDR2/FLDR3/FILENAME
>>>
>>> Only change is the server name all other values will remain same.
>>>
>>> Any help would be really appreciated.
>>
>> One approach would be to use the find command given above to generate a
>> list of files that have changed. Then pass that list to rsync via the
>> '--files-from' option to transfer them to the other server.
>>

Oh, you mean this?

I know this has never been brought up before, certainly not in the
last month or so, but this list has some conventions:

1) Trim your replies
2) Bottom post

See why?

Thanks.

mhr
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 06-10-2008, 05:50 PM
Scott Silva
 
Default Copying files from specific date.

....

Any help would be really appreciated.

One approach would be to use the find command given above to generate a
list of files that have changed. Then pass that list to rsync via the
'--files-from' option to transfer them to the other server.



Oh, you mean this?

I know this has never been brought up before, certainly not in the
last month or so, but this list has some conventions:

1) Trim your replies
2) Bottom post



I thought I heard that somewhere! ;-P


--
MailScanner is like deodorant...
You hope everybody uses it, and
you notice quickly if they don't!!!!

_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 06-10-2008, 08:43 PM
Johnny Hughes
 
Default Copying files from specific date.

Scott Silva wrote:
<snip>


I know this has never been brought up before, certainly not in the
last month or so, but this list has some conventions:

1) Trim your replies
2) Bottom post



I thought I heard that somewhere! ;-P



oh boy ... I feel another 100 post thread coming

_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 06-10-2008, 09:59 PM
"William L. Maltby"
 
Default Copying files from specific date.

On Tue, 2008-06-10 at 15:43 -0500, Johnny Hughes wrote:
> Scott Silva wrote:
> <snip>
> >>
> >> I know this has never been brought up before, certainly not in the
> >> last month or so, but this list has some conventions:
> >>
> >> 1) Trim your replies
> >> 2) Bottom post
> >>
> >
> > I thought I heard that somewhere! ;-P
> >
>
> oh boy ... I feel another 100 post thread coming

<*chuckle*>

The way it goes here, I think it ends up being a 100 thread post. ;->
... Of 100 posts. :-(

> <snip sig stuff>

--
Bill

_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 

Thread Tools




All times are GMT. The time now is 11:49 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org