05-19-2010
Count files every hour
Hi,
I have a directory which uploads files every minute.I want to check the number of files uploaded for every one hour.
I want to run a cron every hour to chk this but iam hanged like how to write the script.
Like the script should count for one hr ie from 00:00 to 01:00 hrs then next hr when the cron is run shld chk for 01:00 to 02:00 hrs.
Can someone guide me to start writing this script.
Regards,
Nessj
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hi,
I have some files in a folder with different time stamps and
I want to display the files which are older than 1 hour.
i tried with find.
need urgent help. (3 Replies)
Discussion started by: vgs
3 Replies
2. UNIX for Dummies Questions & Answers
Hi,
I need to create a script whcih ill run ever hour and will check all the files which are created in that hour for an error string.
Need help in finding all the files which were created in the last 1 hour.
Thanks in Advance.
Asheesh (4 Replies)
Discussion started by: Asheesh
4 Replies
3. Shell Programming and Scripting
trying to find a way to locate files modified in the last hour in a shell script, unfortunately the command 'find . -mmin -60' is not supported on SunOS 5.10 (works on OpenSolaris 5.11 :mad:)
Does anyone know a method of doing this in shell script on 5.10?
cheers (19 Replies)
Discussion started by: rich@ardz
19 Replies
4. Shell Programming and Scripting
Hi,
I am trying to grep a particular string from the files of 2 different servers without copying and calculate the total count of its occurence on both files.
File structure is same on both servers and for reference as follows:
27-Aug-2010... (4 Replies)
Discussion started by: poweroflinux
4 Replies
5. Shell Programming and Scripting
Hello,
In a HP-UX system we receive several files evry hour.
The file is in the format filename+hour e.g:
sv00
sv01
sv02
sv03
sv04
sv05
sv06
sv07
sv08
sv09
sv10
sv11
sv12
sv13
sv14
sv15 (2 Replies)
Discussion started by: drbiloukos
2 Replies
6. Shell Programming and Scripting
Hi friends, I want to convert 24 hour timing to 12 hour please help me...
my data file looks like this..
13-Nov-2011 13:27:36 15.32044 72.68502
13-Nov-2011 12:08:31 15.31291 72.69807
16-Nov-2011 01:16:54 15.30844 72.74028
15-Nov-2011 20:09:25 15.35096 ... (13 Replies)
Discussion started by: nex_asp
13 Replies
7. Shell Programming and Scripting
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.
-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... (2 Replies)
Discussion started by: akore83
2 Replies
8. UNIX for Dummies Questions & Answers
HP Unix Version: HP-UX B.11.31 U ia64
Question
I look for script or command to find files which are older than one hour.
Tried below;
# set the file time to 1 hours ago
touch -t 201307160700 ./touchfile
find /app/grid/product/11.2.0.3/rdbms/audit -name '*.aud' -type f ! -newer... (4 Replies)
Discussion started by: Siva SQL
4 Replies
9. Shell Programming and Scripting
Hi,
Out of a list of files in a directory, I want to find the files which were created/modified more than 1 hour ago. I am using HP -UNIX and it does not support the argument -mmin. Please advise.
I am using # !/bin/sh (4 Replies)
Discussion started by: jhilmil
4 Replies
10. Shell Programming and Scripting
hi All, Any one answer my requirement.
I have source location
src_dir="/home/oracle/arun/IRMS-CM"
My Target location
dest_dir="/home/oracle/arun/LiveLink/IRMS-CM/$dc/$pc/$ct"
my source text files check with below example.text file content
$fn "\t" $dc "\t" $pc "\t" ... (3 Replies)
Discussion started by: sravanreddy
3 Replies
GMMKTIME(3) 1 GMMKTIME(3)
gmmktime - Get Unix timestamp for a GMT date
SYNOPSIS
int gmmktime ([int $hour = gmdate("H")], [int $minute = gmdate("i")], [int $second = gmdate("s")], [int $month = gmdate("n")], [int
$day = gmdate("j")], [int $year = gmdate("Y")], [int $is_dst = -1])
DESCRIPTION
Identical to mktime(3) except the passed parameters represents a GMT date. gmmktime(3) internally uses mktime(3) so only times valid in
derived local time can be used.
Like mktime(3), arguments may be left out in order from right to left, with any omitted arguments being set to the current corresponding
GMT value.
PARAMETERS
o $hour
- The number of the hour relative to the start of the day determined by $month, $day and $year. Negative values reference the hour
before midnight of the day in question. Values greater than 23 reference the appropriate hour in the following day(s).
o $minute
- The number of the minute relative to the start of the $hour. Negative values reference the minute in the previous hour. Values
greater than 59 reference the appropriate minute in the following hour(s).
o $second
- The number of seconds relative to the start of the $minute. Negative values reference the second in the previous minute. Values
greater than 59 reference the appropriate second in the following minute(s).
o $month
- The number of the month relative to the end of the previous year. Values 1 to 12 reference the normal calendar months of the
year in question. Values less than 1 (including negative values) reference the months in the previous year in reverse order, so 0
is December, -1 is November, etc. Values greater than 12 reference the appropriate month in the following year(s).
o $day
- The number of the day relative to the end of the previous month. Values 1 to 28, 29, 30 or 31 (depending upon the month) refer-
ence the normal days in the relevant month. Values less than 1 (including negative values) reference the days in the previous
month, so 0 is the last day of the previous month, -1 is the day before that, etc. Values greater than the number of days in the
relevant month reference the appropriate day in the following month(s).
o $year
- The year
o $is_dst
- Parameters always represent a GMT date so $is_dst doesn't influence the result.
Note
This parameter has been removed in PHP 7.0.0.
RETURN VALUES
Returns a integer Unix timestamp.
CHANGELOG
+--------+---------------------------------------------------+
|Version | |
| | |
| | Description |
| | |
+--------+---------------------------------------------------+
| 7.0.0 | |
| | |
| | $is_dst parameter has been removed. |
| | |
| 5.1.0 | |
| | |
| | As of PHP 5.1.0, the $is_dst parameter became |
| | deprecated. As a result, the new timezone han- |
| | dling features should be used instead. |
| | |
+--------+---------------------------------------------------+
EXAMPLES
Example #1
gmmktime(3) basic example
<?php
// Prints: July 1, 2000 is on a Saturday
echo "July 1, 2000 is on a " . date("l", gmmktime(0, 0, 0, 7, 1, 2000));
?>
SEE ALSO
mktime(3), date(3), time(3).
PHP Documentation Group GMMKTIME(3)