|
|||||||
| Forums | Search Forums | Register | Forum Rules | Man Pages | Albums | FAQ | Members | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
|
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Hello Masters, I need one help. I want to copy the files which are continuously generating on one server. But this would be on hourly basis. e.g. Code:
-rw-rw-r-- 1 akore akore 0 Feb 12 03:20 test1.log -rw-rw-r-- 1 akore akore 0 Feb 12 03:42 test2.log -rw-rw-r-- 1 akore akore 0 Feb 12 04:22 test3.log -rw-rw-r-- 1 akore akore 0 Feb 12 04:50 test4.log -rw-rw-r-- 1 akore akore 0 Feb 12 05:22 test5.log -rw-rw-r-- 1 akore akore 0 Feb 12 05:42 test6.log -rw-rw-r-- 1 akore akore 0 Feb 12 06:55 test7.log -rw-rw-r-- 1 akore akore 0 Feb 12 06:58 test8.log -rw-rw-r-- 1 akore akore 0 Feb 12 07:17 test9.log -rw-rw-r-- 1 akore akore 0 Feb 12 07:28 test10.log From above first I need to copy the files which are generated between Feb 12 03:00 to Feb 12 03:59. Code:
Then Feb 12 04:00 to Feb 12 04:59 Then Feb 12 05:00 to Feb 12 05:59 and so on. That means in 24 hrs my script will copy 24 times. I need this on daily basis. I will set a cronjob for this. But not sure how to pick. Please help me over here so I can copy the files on ourly basis. Thanks in advance Last edited by Scrutinizer; 02-11-2013 at 08:17 AM.. Reason: code tags |
| Sponsored Links | ||
|
|
#2
|
|||
|
|||
|
find and copy
Hello,
use find with time options (-mtime, -ctime, -atime, -cmin ....) and -exec cp in your cron. |
| The Following User Says Thank You to bdittmar For This Useful Post: | ||
akore83 (02-11-2013) | ||
| Sponsored Links | ||
|
|
#3
|
|||
|
|||
|
Touch two files with the right times and "find ... -type f -newer low_time ! -newer high_time"?
|
| The Following User Says Thank You to DGPickett For This Useful Post: | ||
akore83 (02-12-2013) | ||
| Sponsored Links | ||
|
![]() |
| Tags |
| copy, hourly, pick, specific time frame., time frame |
| Thread Tools | Search this Thread |
| Display Modes | |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to tail real time file Generated every hour? | ooilinlove | Shell Programming and Scripting | 7 | 04-30-2012 04:27 AM |
| Files generated today | kusathy | Shell Programming and Scripting | 3 | 12-30-2011 06:57 AM |
| core files not getting generated | asalman.qazi | Solaris | 4 | 11-23-2009 09:10 AM |
| Type v for generated files | shubhranshu | UNIX for Advanced & Expert Users | 2 | 05-06-2009 03:54 AM |
| Ftp all the generated files | im_new | Shell Programming and Scripting | 3 | 12-22-2007 05:46 AM |
|
|