Hello all!
I have found a new home, this place is great!
I have been searching for days to find a way to set a max size for a log.txt file using a cron job exicuting a shell script. Is it possible for a script to remove older entries in a log file to maintain a limited file size? If so,... (5 Replies)
Hello,
Can someone please tell me which command to use to determine the size of a file? When I log in to my shell account, I do this
$>% ls -als
total 632
8 -rw-r--r-- 1 user01 devgrp1 1558 Jul 30 23:25 .kshrc
What is "1158"? Bytes? Kilobytes?
I apologize if my... (8 Replies)
We have Sun OS 5.9 we are doing a backup process (ProC program) that uses the function...
fprintf(fp,"%s;%s;%s;%s;%s;%ld;%ld;%ld;%ld;%s;%s;%s;%d;%s;%s;%s;%ld;%s;%s;%s;%ld;%ld;%s;%ld;%s;%ld;%s;%s;%c%c",x_contrno, x_subno, x_b_subno,x_transdate,x_last_traffic_date,BillAmt_s, x_billamount_int,... (10 Replies)
Hi All,
We are running HP rp7400 box with hpux 11iv1.
Recently, we changed 3 kernel parameters
a) msgseg from 32560 to 32767
b) msgmnb from 65536 to 65535
c) msgssz from 128 to 256
Then we noticed that all application debug file size increase upto 2GB then it stops. So far we did not... (1 Reply)
Hello All,
I am working on an issue, where I need to check the max file size of a file. If the file size exceeds 2 GB, then I need to generate an error message. Since the file system does not allow a file to be created larger than 2 GB, I am planning to use named pipes & AWK file to acheive my... (6 Replies)
I have file listed like below
-rw-r--r--+ 1 test test 17M Nov 26 14:43 test1.gz
-rw-r--r--+ 1 test test 0 Nov 26 14:44 test2.gz
-rw-r--r--+ 1 test test 0 Nov 27 10:41 test3.gz
-rw-r--r--+ 1 test test 244K Nov 27 10:41 test4.gz
-rw-r--r--+ 1 test test 17M Nov 27 10:41 test5.gz
I... (5 Replies)
Hi,
I've compiled a 64-bit version of ClamAV 0.98.7 on my Solaris 10 SPARC server. I have a selection of files all containing the eicar signature but clamd is only picking up the signature in the files <2GB.
I have the following set in clamd.conf, to remove file size checking:
MaxScanSize 0... (4 Replies)
Discussion started by: Troutfest
4 Replies
LEARN ABOUT PHP
posix_getrlimit
POSIX_GETRLIMIT(3) 1 POSIX_GETRLIMIT(3)posix_getrlimit - Return info about system resource limitsSYNOPSIS
array posix_getrlimit (void )
DESCRIPTION posix_getrlimit(3) returns an array of information about the current resource's soft and hard limits.
Each resource has an associated soft and hard limit. The soft limit is the value that the kernel enforces for the corresponding resource.
The hard limit acts as a ceiling for the soft limit. An unprivileged process may only set its soft limit to a value from 0 to the hard
limit, and irreversibly lower its hard limit.
RETURN VALUES
Returns an associative array of elements for each limit that is defined. Each limit has a soft and a hard limit.
List of possible limits returned
+-----------+---------------------------------------------------+
|Limit name | |
| | |
| | Limit description |
| | |
+-----------+---------------------------------------------------+
| core | |
| | |
| | The maximum size of the core file. When 0, not |
| | core files are created. When core files are |
| | larger than this size, they will be truncated at |
| | this size. |
| | |
| totalmem | |
| | |
| | The maximum size of the memory of the process, |
| | in bytes. |
| | |
|virtualmem | |
| | |
| | The maximum size of the virtual memory for the |
| | process, in bytes. |
| | |
| data | |
| | |
| | The maximum size of the data segment for the |
| | process, in bytes. |
| | |
| stack | |
| | |
| | The maximum size of the process stack, in bytes. |
| | |
| rss | |
| | |
| | The maximum number of virtual pages resident in |
| | RAM |
| | |
| maxproc | |
| | |
| | The maximum number of processes that can be cre- |
| | ated for the real user ID of the calling process. |
| | |
| memlock | |
| | |
| | The maximum number of bytes of memory that may |
| | be locked into RAM. |
| | |
| cpu | |
| | |
| | The amount of time the process is allowed to use |
| | the CPU. |
| | |
| filesize | |
| | |
| | The maximum size of the data segment for the |
| | process, in bytes. |
| | |
|openfiles | |
| | |
| | One more than the maximum number of open file |
| | descriptors. |
| | |
+-----------+---------------------------------------------------+
EXAMPLES
Example #1
Example use of posix_getrlimit(3)
<?php
$limits = posix_getrlimit();
print_r($limits);
?>
The above example will output something similar to:
Array
(
[soft core] => 0
[hard core] => unlimited
[soft data] => unlimited
[hard data] => unlimited
[soft stack] => 8388608
[hard stack] => unlimited
[soft totalmem] => unlimited
[hard totalmem] => unlimited
[soft rss] => unlimited
[hard rss] => unlimited
[soft maxproc] => unlimited
[hard maxproc] => unlimited
[soft memlock] => unlimited
[hard memlock] => unlimited
[soft cpu] => unlimited
[hard cpu] => unlimited
[soft filesize] => unlimited
[hard filesize] => unlimited
[soft openfiles] => 1024
[hard openfiles] => 1024
)
NOTES
Note
This is a not POSIX function, but is common on BSD and System V systems. If the system does not support this function, then it will
not be included at compile time. This may be checked with function_exists(3).
SEE ALSO
man page GETRLIMIT(2).
PHP Documentation Group POSIX_GETRLIMIT(3)