Help - To copy and compress files one day ago


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Help - To copy and compress files one day ago
# 1  
Old 02-04-2016
Help - To copy and compress files one day ago

Hi dears,

Hi All,
I'm a new member of this Forum. I have need your help to handle this request.

"I want to copy and Compress files not of today but of yesterday only using some script".

For example

I have the following files under a particular directory in a Solaris machine.

Code:
-rw-r--r--   1 rtp99    dba          16M Feb  3 17:29 RtpTrcError.0034
-rw-r--r--   1 rtp99    dba          16M Feb  3 18:09 RtpTrcError.0035
-rw-r--r--   1 rtp99    dba          16M Feb  3 18:56 RtpTrcError.0036
-rw-r--r--   1 rtp99    dba          16M Feb  3 19:42 RtpTrcError.0037
-rw-r--r--   1 rtp99    dba          16M Feb  3 20:35 RtpTrcError.0038
-rw-r--r--   1 rtp99    dba          16M Feb  3 21:15 RtpTrcError.0039
-rw-r--r--   1 rtp99    dba          13M Feb  3 22:15 RtpTrcError.0040
-rw-r--r--   1 rtp99    dba          10M Feb  3 23:15 RtpTrcError.0041
-rw-r--r--   1 rtp99    dba         9.2M Feb  4 00:15 RtpTrcError.0042
-rw-r--r--   1 rtp99    dba         7.0M Feb  4 01:15 RtpTrcError.0043
-rw-r--r--   1 rtp99    dba         6.9M Feb  4 02:15 RtpTrcError.0044
-rw-r--r--   1 rtp99    dba         6.6M Feb  4 03:15 RtpTrcError.0045
-rw-r--r--   1 rtp99    dba         6.0M Feb  4 04:15 RtpTrcError.0046
-rw-r--r--   1 rtp99    dba         5.1M Feb  4 05:15 RtpTrcError.0047
-rw-r--r--   1 rtp99    dba         7.8M Feb  4 06:15 RtpTrcError.0048
-rw-r--r--   1 rtp99    dba          13M Feb  4 07:15 RtpTrcError.0049
-rw-r--r--   1 rtp99    dba          15M Feb  4 08:15 RtpTrcError.0050
-rw-r--r--   1 rtp99    dba          15M Feb  4 09:15 RtpTrcError.0051
-rw-r--r--   1 rtp99    dba          16M Feb  4 09:56 RtpTrcError.0052
-rw-r--r--   1 rtp99    dba          16M Feb  4 10:26 RtpTrcError.0053
-rw-r--r--   1 rtp99    dba         6.7M Feb  4 10:40 RtpTrcError.0054

I need to copy and compress ONLY the files of yesterday (Here 3 Feb).

Any suggestion will be well appreciated.

Thanks in advance for your kind support.

Regards,

Jacky.

Last edited by Don Cragun; 02-04-2016 at 03:54 AM.. Reason: Add CODE tags.
# 2  
Old 02-04-2016
Please use code tags as required by forum rules!

What exactly do you want to do? What tool(s) do you want to use? find has e.g. the -mtime test, as has tar.
# 3  
Old 02-04-2016
You are only showing files from today and yesterday in your example. Is that because older files have been moved and compressed, or are older files present, but just not shown in your example?

Do you want to COPY and compress or MOVE and compress? (I.e., do you want to leave an unmodified version of the file where it is while creating a compressed version of the file somewhere else, or do you just want to create a compressed version of the file somewhere else and remove the original file?)

What is the name of the directory containing these files?

What is the name of the directory in which you want to create the compressed copies of your files?

What utility do you want to use to compress your files? (Some possibilities include compress, pack, and zip.)

What do you mean by yesterday? (Are you looking for files that are 24 to 48 hours old when you run the script? Or, are you looking for files that were created between midnight at the start of yesterday and midnight at the start of today?)
# 4  
Old 02-04-2016
Dear Rudic,

Sorry about code tags, actually I didn't know how do it.

@Don, Please see in line my answers to your queries.

Do you want to COPY and compress or MOVE and compress? (I.e., do you want to leave an unmodified version of the file where it is while creating a compressed version of the file somewhere else, or do you just want to create a compressed version of the file somewhere else and remove the original file?)

[Jacky]: I want to COPY and compress files in a single command line using zip/gzip or any other command. I dont want to disturb oringinal files in the source directory (/dump/traces/...)

What is the name of the directory containing these files?
[Jacky]:
Source Dir = /opt/TGS/traces
Target Dir = /dump/old_traces


What is the name of the directory in which you want to create the compressed copies of your files?
[Jacky]: /dump/old_traces


What utility do you want to use to compress your files? (Some possibilities include compress , pack , and zip .)
[Jacky]: zip

What do you mean by yesterday? (Are you looking for files that are 24 to 48 hours old when you run the script? Or, are you looking for files that were created between midnight at the start of yesterday and midnight at the start of today?)

[Jacky]: For example, below you can see the list of files. So now I want to copy/compress all files of 3rd Feb only (i.e. yesterday).


Code:
-rw-r--r--   1 rtp99    dba         228K Feb  3 00:57 RtpTrcError.0096
-rw-r--r--   1 rtp99    dba         289K Feb  3 01:57 RtpTrcError.0097
-rw-r--r--   1 rtp99    dba         228K Feb  3 02:57 RtpTrcError.0098
-rw-r--r--   1 rtp99    dba         228K Feb  3 03:57 RtpTrcError.0099
-rw-r--r--   1 rtp99    dba         229K Feb  3 04:57 RtpTrcError.0000
-rw-r--r--   1 rtp99    dba         229K Feb  3 05:57 RtpTrcError.0001
-rw-r--r--   1 rtp99    dba         228K Feb  3 06:57 RtpTrcError.0002
-rw-r--r--   1 rtp99    dba         244K Feb  3 07:58 RtpTrcError.0003
-rw-r--r--   1 rtp99    dba         228K Feb  3 08:58 RtpTrcError.0004
-rw-r--r--   1 rtp99    dba         228K Feb  3 09:57 RtpTrcError.0005
-rw-r--r--   1 rtp99    dba         228K Feb  3 10:58 RtpTrcError.0006
-rw-r--r--   1 rtp99    dba         273K Feb  3 11:58 RtpTrcError.0007
-rw-r--r--   1 rtp99    dba         229K Feb  3 12:58 RtpTrcError.0008
-rw-r--r--   1 rtp99    dba         250K Feb  3 13:58 RtpTrcError.0009
-rw-r--r--   1 rtp99    dba         229K Feb  3 14:58 RtpTrcError.0010
-rw-r--r--   1 rtp99    dba         259K Feb  3 15:58 RtpTrcError.0011
-rw-r--r--   1 rtp99    dba         228K Feb  3 16:58 RtpTrcError.0012
-rw-r--r--   1 rtp99    dba         244K Feb  3 17:58 RtpTrcError.0013
-rw-r--r--   1 rtp99    dba         302K Feb  3 18:58 RtpTrcError.0014
-rw-r--r--   1 rtp99    dba         280K Feb  3 19:58 RtpTrcError.0015
-rw-r--r--   1 rtp99    dba         243K Feb  3 20:58 RtpTrcError.0016
-rw-r--r--   1 rtp99    dba         228K Feb  3 21:58 RtpTrcError.0017
-rw-r--r--   1 rtp99    dba         229K Feb  3 22:59 RtpTrcError.0018
-rw-r--r--   1 rtp99    dba         228K Feb  3 23:58 RtpTrcError.0019
-rw-r--r--   1 rtp99    dba         230K Feb  4 00:59 RtpTrcError.0020
-rw-r--r--   1 rtp99    dba         240K Feb  4 01:59 RtpTrcError.0021
-rw-r--r--   1 rtp99    dba         229K Feb  4 02:59 RtpTrcError.0022
-rw-r--r--   1 rtp99    dba         235K Feb  4 03:59 RtpTrcError.0023
-rw-r--r--   1 rtp99    dba         229K Feb  4 04:59 RtpTrcError.0024
-rw-r--r--   1 rtp99    dba         229K Feb  4 05:59 RtpTrcError.0025
-rw-r--r--   1 rtp99    dba         228K Feb  4 06:59 RtpTrcError.0026
-rw-r--r--   1 rtp99    dba         243K Feb  4 07:59 RtpTrcError.0027
-rw-r--r--   1 rtp99    dba         229K Feb  4 08:59 RtpTrcError.0028
-rw-r--r--   1 rtp99    dba         287K Feb  4 09:59 RtpTrcError.0029
-rw-r--r--   1 rtp99    dba         338K Feb  4 11:00 RtpTrcError.0030
-rw-r--r--   1 rtp99    dba         238K Feb  4 11:59 RtpTrcError.0031
-rw-r--r--   1 rtp99    dba         226K Feb  4 13:00 RtpTrcError.0032
-rw-r--r--   1 rtp99    dba         180K Feb  4 13:35 RtpTrcError.0033



Thanks,

Regards,
Moderator's Comments:
Mod Comment Directions, including a tutorial video, showing you how to use CODE tags and ICODE tags for sample input, sample output, and for code segments was sent to you when you received your first warning for not using CODE tags.

Please review that tutorial and start formatting your posts correctly yourself. Don't depend on moderators and administrators to clean up your posts.

Last edited by Don Cragun; 02-04-2016 at 02:46 PM.. Reason: Add CODE and ICODE tags.
# 5  
Old 02-04-2016
Quote:
Originally Posted by JackyJohn
Dear Rudic,

Sorry about code tags, actually I didn't know how do it.

@Don, Please see in line my answers to your queries.

Do you want to COPY and compress or MOVE and compress? (I.e., do you want to leave an unmodified version of the file where it is while creating a compressed version of the file somewhere else, or do you just want to create a compressed version of the file somewhere else and remove the original file?)

[Jacky]: I want to COPY and compress files in a single command line using zip/gzip or any other command. I dont want to disturb oringinal files in the source directory (/dump/traces/...)

What is the name of the directory containing these files?
[Jacky]:
Source Dir = /opt/TGS/traces
Target Dir = /dump/old_traces


What is the name of the directory in which you want to create the compressed copies of your files?
[Jacky]: /dump/old_traces


What utility do you want to use to compress your files? (Some possibilities include compress , pack , and zip .)
[Jacky]: zip

What do you mean by yesterday? (Are you looking for files that are 24 to 48 hours old when you run the script? Or, are you looking for files that were created between midnight at the start of yesterday and midnight at the start of today?)

[Jacky]: For example, below you can see the list of files. So now I want to copy/compress all files of 3rd Feb only (i.e. yesterday).


Code:
-rw-r--r--   1 rtp99    dba         228K Feb  3 00:57 RtpTrcError.0096
-rw-r--r--   1 rtp99    dba         289K Feb  3 01:57 RtpTrcError.0097
-rw-r--r--   1 rtp99    dba         228K Feb  3 02:57 RtpTrcError.0098
-rw-r--r--   1 rtp99    dba         228K Feb  3 03:57 RtpTrcError.0099
-rw-r--r--   1 rtp99    dba         229K Feb  3 04:57 RtpTrcError.0000
-rw-r--r--   1 rtp99    dba         229K Feb  3 05:57 RtpTrcError.0001
-rw-r--r--   1 rtp99    dba         228K Feb  3 06:57 RtpTrcError.0002
-rw-r--r--   1 rtp99    dba         244K Feb  3 07:58 RtpTrcError.0003
-rw-r--r--   1 rtp99    dba         228K Feb  3 08:58 RtpTrcError.0004
-rw-r--r--   1 rtp99    dba         228K Feb  3 09:57 RtpTrcError.0005
-rw-r--r--   1 rtp99    dba         228K Feb  3 10:58 RtpTrcError.0006
-rw-r--r--   1 rtp99    dba         273K Feb  3 11:58 RtpTrcError.0007
-rw-r--r--   1 rtp99    dba         229K Feb  3 12:58 RtpTrcError.0008
-rw-r--r--   1 rtp99    dba         250K Feb  3 13:58 RtpTrcError.0009
-rw-r--r--   1 rtp99    dba         229K Feb  3 14:58 RtpTrcError.0010
-rw-r--r--   1 rtp99    dba         259K Feb  3 15:58 RtpTrcError.0011
-rw-r--r--   1 rtp99    dba         228K Feb  3 16:58 RtpTrcError.0012
-rw-r--r--   1 rtp99    dba         244K Feb  3 17:58 RtpTrcError.0013
-rw-r--r--   1 rtp99    dba         302K Feb  3 18:58 RtpTrcError.0014
-rw-r--r--   1 rtp99    dba         280K Feb  3 19:58 RtpTrcError.0015
-rw-r--r--   1 rtp99    dba         243K Feb  3 20:58 RtpTrcError.0016
-rw-r--r--   1 rtp99    dba         228K Feb  3 21:58 RtpTrcError.0017
-rw-r--r--   1 rtp99    dba         229K Feb  3 22:59 RtpTrcError.0018
-rw-r--r--   1 rtp99    dba         228K Feb  3 23:58 RtpTrcError.0019
-rw-r--r--   1 rtp99    dba         230K Feb  4 00:59 RtpTrcError.0020
-rw-r--r--   1 rtp99    dba         240K Feb  4 01:59 RtpTrcError.0021
-rw-r--r--   1 rtp99    dba         229K Feb  4 02:59 RtpTrcError.0022
-rw-r--r--   1 rtp99    dba         235K Feb  4 03:59 RtpTrcError.0023
-rw-r--r--   1 rtp99    dba         229K Feb  4 04:59 RtpTrcError.0024
-rw-r--r--   1 rtp99    dba         229K Feb  4 05:59 RtpTrcError.0025
-rw-r--r--   1 rtp99    dba         228K Feb  4 06:59 RtpTrcError.0026
-rw-r--r--   1 rtp99    dba         243K Feb  4 07:59 RtpTrcError.0027
-rw-r--r--   1 rtp99    dba         229K Feb  4 08:59 RtpTrcError.0028
-rw-r--r--   1 rtp99    dba         287K Feb  4 09:59 RtpTrcError.0029
-rw-r--r--   1 rtp99    dba         338K Feb  4 11:00 RtpTrcError.0030
-rw-r--r--   1 rtp99    dba         238K Feb  4 11:59 RtpTrcError.0031
-rw-r--r--   1 rtp99    dba         226K Feb  4 13:00 RtpTrcError.0032
-rw-r--r--   1 rtp99    dba         180K Feb  4 13:35 RtpTrcError.0033



Thanks,

Regards,
Moderator's Comments:
Mod Comment Directions, including a tutorial video, showing you how to use CODE tags and ICODE tags for sample input, sample output, and for code segments was sent to you when you received your first warning for not using CODE tags.

Please review that tutorial and start formatting your posts correctly yourself. Don't depend on moderators and administrators to clean up your posts.
You'll have to note that I'm not a big fan of 1-liners. I MUCH prefer code that is easier to read, understand, and maintain.

You haven't said what operating system and shell you're using nor what timezone is in use in your location. The following code works with a recent version of the 1993 Korn shell on OS X. Other methods to get yesterday's date (some simpler, some harder, and some a lot harder) can be used on other systems, using date, perl or other utilities:
Code:
#!/bin/ksh
SRC_DIR='/opt/TGS/traces'
DEST_DIR='/dump/old_traces'

cd "$SRC_DIR"
ls -l RtpTrcError* | grep -F "$(printf '%(%b %e)T\n' "1 day ago")" |
while read _ _ _ _ _ _ _ _ name
do	zip "$DEST_DIR/$name.zip" "$name"
done

# 6  
Old 02-05-2016
Did you consider zip's -t and -tt options? man zip:
Quote:
-t mmddyyyy
--from-date mmddyyyy
Do not operate on files modified prior to the specified date,
.
.
.
-tt mmddyyyy
--before-date mmddyyyy
Do not operate on files modified after or at the specified date
# 7  
Old 02-08-2016
Dear Don,

Many thanks for your response and sorry for missing information. I have Solaris 9 running on my machine and using bourn shell.


I have used your code to first display the files of yesterday before zipping them, but got the following error.

Code:
root@> ls -l RtpTrcError* | /usr/xpg4/bin/grep -F "$(printf '%(%b %e)T\n' "1 day ago")" | while read _ _ _ _ _ _ _ _ name
> do ls -ltr $name;done
bash: printf: `(': invalid format character

-rw-r--r--   1 rtp99    dba       237210 Feb  7 09:05 RtpTrcError.0000
-rw-r--r--   1 rtp99    dba       235928 Feb  7 10:05 RtpTrcError.0001
-rw-r--r--   1 rtp99    dba       270332 Feb  7 11:05 RtpTrcError.0002
-rw-r--r--   1 rtp99    dba       243644 Feb  7 12:05 RtpTrcError.0003
-rw-r--r--   1 rtp99    dba       236638 Feb  7 13:05 RtpTrcError.0004
-rw-r--r--   1 rtp99    dba       267266 Feb  7 14:05 RtpTrcError.0005
-rw-r--r--   1 rtp99    dba       251980 Feb  7 15:05 RtpTrcError.0006
-rw-r--r--   1 rtp99    dba       251759 Feb  7 16:05 RtpTrcError.0007
-rw-r--r--   1 rtp99    dba       237410 Feb  7 17:05 RtpTrcError.0008
-rw-r--r--   1 rtp99    dba       244197 Feb  7 18:05 RtpTrcError.0009
-rw-r--r--   1 rtp99    dba       335545 Feb  7 19:05 RtpTrcError.0010
-rw-r--r--   1 rtp99    dba       252114 Feb  7 20:05 RtpTrcError.0011
-rw-r--r--   1 rtp99    dba       237055 Feb  7 21:06 RtpTrcError.0012
-rw-r--r--   1 rtp99    dba       236635 Feb  7 22:06 RtpTrcError.0013
-rw-r--r--   1 rtp99    dba       236082 Feb  7 23:06 RtpTrcError.0014
-rw-r--r--   1 rtp99    dba       237209 Feb  8 00:06 RtpTrcError.0015
-rw-r--r--   1 rtp99    dba       245933 Feb  8 01:06 RtpTrcError.0016
-rw-r--r--   1 rtp99    dba       240790 Feb  8 02:06 RtpTrcError.0017
-rw-r--r--   1 rtp99    dba       236859 Feb  8 03:06 RtpTrcError.0018
-rw-r--r--   1 rtp99    dba       236281 Feb  8 04:06 RtpTrcError.0019
-rw-r--r--   1 rtp99    dba       236282 Feb  8 05:06 RtpTrcError.0020
-rw-r--r--   1 rtp99    dba       236635 Feb  8 06:06 RtpTrcError.0021
-rw-r--r--   1 rtp99    dba       237764 Feb  8 07:06 RtpTrcError.0022
-rw-r--r--   1 rtp99    dba       251206 Feb  8 08:06 RtpTrcError.0023
-rw-r--r--   1 rtp99    dba       236990 Feb  8 09:06 RtpTrcError.0024
-rw-r--r--   1 rtp99    dba       235927 Feb  8 10:07 RtpTrcError.0025
-rw-r--r--   1 rtp99    dba       245804 Feb  8 11:07 RtpTrcError.0026
-rw-r--r--   1 rtp99    dba       257839 Feb  8 12:07 RtpTrcError.0027
-rw-r--r--   1 rtp99    dba       236282 Feb  8 13:07 RtpTrcError.0028
-rw-r--r--   1 rtp99    dba       249082 Feb  8 14:07 RtpTrcError.0029
-rw-r--r--   1 rtp99    dba       235927 Feb  8 15:07 RtpTrcError.0030
-rw-r--r--   1 rtp99    dba       244552 Feb  8 16:07 RtpTrcError.0031
-rw-r--r--   1 rtp99    dba       251207 Feb  8 17:07 RtpTrcError.0032
-rw-r--r--   1 rtp99    dba       243910 Feb  8 18:07 RtpTrcError.0033
-rw-r--r--   1 rtp99    dba       300647 Feb  8 19:07 RtpTrcError.0034
-rw-r--r--   1 rtp99    dba       252114 Feb  8 20:07 RtpTrcError.0035
-rw-r--r--   1 rtp99    dba       236282 Feb  8 21:07 RtpTrcError.0036
-rw-r--r--   1 rtp99    dba       235794 Feb  8 22:07 RtpTrcError.0037
-rw-r--r--   1 rtp99    dba       236635 Feb  8 23:07 RtpTrcError.0038
-rw-r--r--   1 rtp99    dba       237274 Feb  9 00:08 RtpTrcError.0039
-rw-r--r--   1 rtp99    dba       245960 Feb  9 01:08 RtpTrcError.0040
-rw-r--r--   1 rtp99    dba       241577 Feb  9 02:08 RtpTrcError.0041
-rw-r--r--   1 rtp99    dba       235574 Feb  9 03:08 RtpTrcError.0042
-rw-r--r--   1 rtp99    dba       235993 Feb  9 04:08 RtpTrcError.0043
-rw-r--r--   1 rtp99    dba       235573 Feb  9 05:08 RtpTrcError.0044
-rw-r--r--   1 rtp99    dba       243290 Feb  9 06:08 RtpTrcError.0045
-rw-r--r--   1 rtp99    dba       245326 Feb  9 07:08 RtpTrcError.0046
-rw-r--r--   1 rtp99    dba       252533 Feb  9 08:08 RtpTrcError.0047
-rw-r--r--   1 rtp99    dba       235728 Feb  9 09:08 RtpTrcError.0048
-rw-r--r--   1 rtp99    dba       237763 Feb  9 10:08 RtpTrcError.0049
-rw-r--r--   1 rtp99    dba       252113 Feb  9 11:08 RtpTrcError.0050
-rw-r--r--   1 rtp99    dba       244197 Feb  9 12:09 RtpTrcError.0051
-rw-r--r--   1 rtp99    dba       237565 Feb  9 13:08 RtpTrcError.0052
-rw-r--r--   1 rtp99    dba       252468 Feb  9 14:08 RtpTrcError.0053
-rw-r--r--   1 rtp99    dba        81689 Feb  9 14:29 RtpTrcError.0054
-rw-r--r--   1 rtp99    dba       249701 Feb  5 12:01 RtpTrcError.0055
-rw-r--r--   1 rtp99    dba       328739 Feb  5 13:01 RtpTrcError.0056
-rw-r--r--   1 rtp99    dba       333158 Feb  5 14:01 RtpTrcError.0057
-rw-r--r--   1 rtp99    dba       260979 Feb  5 15:01 RtpTrcError.0058
-rw-r--r--   1 rtp99    dba       250307 Feb  5 16:02 RtpTrcError.0059
-rw-r--r--   1 rtp99    dba       235878 Feb  5 17:02 RtpTrcError.0060
-rw-r--r--   1 rtp99    dba       259321 Feb  5 18:02 RtpTrcError.0061
-rw-r--r--   1 rtp99    dba       347970 Feb  5 19:02 RtpTrcError.0062
-rw-r--r--   1 rtp99    dba       281365 Feb  5 20:02 RtpTrcError.0063
-rw-r--r--   1 rtp99    dba       236791 Feb  5 21:02 RtpTrcError.0064
-rw-r--r--   1 rtp99    dba       236991 Feb  5 22:02 RtpTrcError.0065
-rw-r--r--   1 rtp99    dba       237410 Feb  5 23:02 RtpTrcError.0066
-rw-r--r--   1 rtp99    dba       236500 Feb  6 00:02 RtpTrcError.0067
-rw-r--r--   1 rtp99    dba       240982 Feb  6 01:02 RtpTrcError.0068
-rw-r--r--   1 rtp99    dba       242204 Feb  6 02:02 RtpTrcError.0069
-rw-r--r--   1 rtp99    dba       237388 Feb  6 03:03 RtpTrcError.0070
-rw-r--r--   1 rtp99    dba       237181 Feb  6 04:03 RtpTrcError.0071
-rw-r--r--   1 rtp99    dba       237764 Feb  6 05:03 RtpTrcError.0072
-rw-r--r--   1 rtp99    dba       236636 Feb  6 06:03 RtpTrcError.0073
-rw-r--r--   1 rtp99    dba       237763 Feb  6 07:03 RtpTrcError.0074
-rw-r--r--   1 rtp99    dba       250499 Feb  6 08:03 RtpTrcError.0075
-rw-r--r--   1 rtp99    dba       235928 Feb  6 09:03 RtpTrcError.0076
-rw-r--r--   1 rtp99    dba       235927 Feb  6 10:03 RtpTrcError.0077
-rw-r--r--   1 rtp99    dba       259542 Feb  6 11:03 RtpTrcError.0078
-rw-r--r--   1 rtp99    dba       251762 Feb  6 12:03 RtpTrcError.0079
-rw-r--r--   1 rtp99    dba       236281 Feb  6 13:03 RtpTrcError.0080
-rw-r--r--   1 rtp99    dba       273124 Feb  6 14:03 RtpTrcError.0081
-rw-r--r--   1 rtp99    dba       234666 Feb  6 15:03 RtpTrcError.0082
-rw-r--r--   1 rtp99    dba       236281 Feb  6 16:03 RtpTrcError.0083
-rw-r--r--   1 rtp99    dba       243490 Feb  6 17:03 RtpTrcError.0084
-rw-r--r--   1 rtp99    dba       252114 Feb  6 18:04 RtpTrcError.0085
-rw-r--r--   1 rtp99    dba       342689 Feb  6 19:04 RtpTrcError.0086
-rw-r--r--   1 rtp99    dba       274091 Feb  6 20:04 RtpTrcError.0087
-rw-r--r--   1 rtp99    dba       237410 Feb  6 21:04 RtpTrcError.0088
-rw-r--r--   1 rtp99    dba       236637 Feb  6 22:04 RtpTrcError.0089
-rw-r--r--   1 rtp99    dba       236082 Feb  6 23:04 RtpTrcError.0090
-rw-r--r--   1 rtp99    dba       237628 Feb  7 00:04 RtpTrcError.0091
-rw-r--r--   1 rtp99    dba       243102 Feb  7 01:04 RtpTrcError.0092
-rw-r--r--   1 rtp99    dba       240807 Feb  7 02:04 RtpTrcError.0093
-rw-r--r--   1 rtp99    dba       236990 Feb  7 03:04 RtpTrcError.0094
-rw-r--r--   1 rtp99    dba       236281 Feb  7 04:04 RtpTrcError.0095
-rw-r--r--   1 rtp99    dba       237919 Feb  7 05:04 RtpTrcError.0096
-rw-r--r--   1 rtp99    dba       235927 Feb  7 06:04 RtpTrcError.0097
-rw-r--r--   1 rtp99    dba       236990 Feb  7 07:04 RtpTrcError.0098
-rw-r--r--   1 rtp99    dba       236635 Feb  7 08:05 RtpTrcError.0099
root@>

Can you please suggest whats wrong with it?

Thanks,

Jacky.

Last edited by JackyJohn; 02-09-2016 at 07:37 AM.. Reason: Add CODE tags for output.
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to copy all structure folder create last day?

HI All, please help , i got same case . i want copy folder and directory create yesterday. for sample below : drwxr-xr-x 4 apps apps 33 Nov 23 04:00 xxxxxx@gmai.com drwxr-xr-x 4 apps apps 33 Nov 23 04:00 yyyyyyy@gmail.com drwxr-xr-x 4 apps apps 33 Nov 24 04:00... (2 Replies)
Discussion started by: fajar_3t3
2 Replies

2. UNIX for Dummies Questions & Answers

Move the files between Current day & a previous day

Hi All, I have a requirement where I need to first capture the current day & move all the files from a particular directory based on a previous day. i.e move all the files from one directory to another based on current day & a previous day. Here is what I am trying, but it gives me errors.... (2 Replies)
Discussion started by: dsfreddie
2 Replies

3. Shell Programming and Scripting

script to compress files in directory that changes its name every day

Hi all I have the following script that should compress a file in a directory: # compress log files older than 2 days find /u01/easydone/DBDUMPS/*.dmp -mtime +2 -exec gzip {} \; BUT the problem is that these files that I want to compress are inside a directory with following format: ... (5 Replies)
Discussion started by: fretagi
5 Replies

4. Shell Programming and Scripting

Help - compress file one day ago

Hi All, I'm a new member of this Forum. I have need your help to handle this request. "Compress a file name not of today but of yesterday only". For example 0 mar 08:00 TEST_RPT_STATUS_M1I_CMI20120320.xls 20 mar 08:00 TEST_RPT_STATUS_M1I_CMI20120320.rep 21 mar 08:00... (6 Replies)
Discussion started by: gio123bgg
6 Replies

5. Shell Programming and Scripting

How to extract the day of the year and use that info to copy a file remotely

Hello, Thank you in advance for helping a newbie who is having great trouble with this simple task. I'm allowed to copy one file remotely each night due to bandwidth restrictions. A new file gets generated once a day, and I need to copy the previous day's file. Here is what I'd like to do:... (1 Reply)
Discussion started by: tmozdzen
1 Replies

6. UNIX for Dummies Questions & Answers

Copy Compress as one command

Hi, I need to copy and compress files in a directory in single line of command. I am able to copy and gzip files in one command but not directory. Command that I am using for copying directory is below : cp -rp /u01/app/<directory> /u01/app/backup |gzip -r /u01/app/backup/<directory> ... (10 Replies)
Discussion started by: findprakash
10 Replies

7. UNIX for Dummies Questions & Answers

Copy and compress

Is there a way to copy a file and compress it at the same time? I realize the file can be copied and then compressed, but I was wondering if it's possible to do it in a one-line command and for that matter, if it would be more efficient to perform the operation with a one-line command? Thanks. (5 Replies)
Discussion started by: here2learn
5 Replies

8. Shell Programming and Scripting

Cron to run first day of month to calculate date 3 months ago

Hi, I would like to find out how can i calculate a date which is 3 months ago. I intend to run a cron job on the 1st of every month, and calculate the month 4 months earlier from the date. For example, if today's date is 1st May 2007, i would like to return 012007( January 2007). i can get... (1 Reply)
Discussion started by: new2ss
1 Replies

9. UNIX for Advanced & Expert Users

Compress and copy a Folder

hi Buddies , How can i Compress and move a folder through UNIX completely to windows 2000 through FTP. (1 Reply)
Discussion started by: scorpiyanz
1 Replies
Login or Register to Ask a Question