Sponsored Content
Full Discussion: growing files
Top Forums Shell Programming and Scripting growing files Post 302485652 by DGPickett on Wednesday 5th of January 2011 10:00:17 PM
Old 01-05-2011
-exec is a bit slow (a fork/exec per hit), so try:
Code:
find . . . | xargs -n999 ls -l

Your -t was a misfiring neuron, as a one file list is always sorted.
Code:
ls -ltd $( find . -mtime -1 )

is nice for one day if you do not swamp ls's file count limit, else see above.

Space can disappear into files being actively appended, so fuser on large, growing files will show the process that is writing.

Space can disappear into huge directories, which have to be recreated to get the space back.

Space can disappear into many new little files, which can be helped a lot with zip archiving!

---------- Post updated at 10:00 PM ---------- Previous update was at 09:46 PM ----------

-exec is a bit slow (a fork/exec per hit), so try:
Code:
find . . . | xargs -n999 ls -l

Your -t was a misfiring neuron, as a one file list is always sorted.
Code:
ls -ltd $( find . -mtime -1 )

is nice for one day if you do not swamp ls's file count limit, else see above. Time sorting can be made more versatile and robust if you can put mtime with the file name and sort -n, so I wrote a stat() wrapper mystat.c that reads file names from stdin and writes mtime\tfile_name\n to stdout.
Code:
#include <stdio.h>
#include <stdlib.h>
#include <limits.h>
#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>

static void psf( char * buf )
{
    struct stat64 s ;

    if ( 0 > stat64( buf, &s ) )
    {
        perror( buf );
        return ; ;
    }

    if ( 0 > printf( "%u\t%s\n", s.st_mtime, buf ) )
    {
        if ( !ferror( stdout ) )
            exit( 0 );
        perror( "stdout" );
        exit( 1 );
    }
}

int main( int argc, char **argv )
{
    char buf[PATH_MAX + 2];
    char *cp ;
    int i ;
    int clf = 0 ;

    for ( i = 1 ; i < argc ; i++ )
    {
        clf ++ ;
        psf( argv[i] );
    }

    if ( !clf ) while ( fgets( buf, sizeof buf, stdin ) )
    {
        if ( !( cp = strchr( buf, '\n' ) ) )
        {
            fprintf( stderr, "File path too long: '%s'\n", buf );
            continue ;
        }

        *cp = NULL ;
        psf( buf );
    }

    if ( !ferror( stdin ) )
        exit( 0 );

    perror( "stdin" );
    exit( 1 );
}

Space can disappear into files being actively appended, so fuser on large, growing files will show the process that is writing.

Space can disappear into huge directories, which have to be recreated to get the space back.

Space can disappear into many new little files, which can be helped a lot with zip archiving!
 

10 More Discussions You Might Find Interesting

1. AIX

AIX Growing Files

Hi Everybody, I want to know the names & locations of the common AIX files which it's size keep growing. I think there is a procedure to clean these files to avoid the space overflow, I wish also if anybody can tell me what is the proper procedure to make more available space. Another issue, that... (2 Replies)
Discussion started by: aldowsary
2 Replies

2. UNIX for Dummies Questions & Answers

.osm file growing

my /etc/.osm file is growing rapidly and logging large amounts of activity. Can anyone tell me what this file is for and what types of information is logged in this file. Thanks in advance for your help!! (1 Reply)
Discussion started by: golfs4us
1 Replies

3. AIX

Help growing iscsi lun

Hi, I have an iSCSI LUN of 200GB. I increased it to 250GB and when I try to increase the size of the vg, I'm getting an error that none of the volumes have increased in size. How can I get the OS to see the additional 50GB? ---------- Post updated at 03:22 PM ---------- Previous update... (9 Replies)
Discussion started by: bbbngowc
9 Replies

4. Solaris

Growing /opt

Hi, /opt on my disk is almost 90%. I thought of growing it. I followed the below procedure: 1. added a new hard disk 2. formatted the same with ufs 3. created a slice and tried to label it as "opt" with "wm" permissions. but got stuck at 3 as it is not allowing me to label the slice... (9 Replies)
Discussion started by: EmbedUX
9 Replies

5. Filesystems, Disks and Memory

Growing a FS over 1T - can it be done ?

Greeting Forumers! I've been asked to increase space in a FS that is currently 740G in size: Filesystem size used avail capacity Mounted on /dev/md/dsk/d664 740G 424G 308G 58% /ora_back My SAN administrator has allocated 5 LUNs of 200G each - this will make... (3 Replies)
Discussion started by: bluescreen
3 Replies

6. Solaris

Help with Growing FS

Ok so I just installed Solaris 10 on my x86 laptop. But I too the defaults and now all of the FS's are very small. I can't install anything. The drive is a 40GB but only about 11GB is being seen and used. How can I get the OS to see and use the rest of the drive? I was just going to reinstall, but... (3 Replies)
Discussion started by: bbbngowc
3 Replies

7. Shell Programming and Scripting

find the rate of growing of filesystem

Hi, I need to find out the gigabytes/hour growth in filesystem.:confused: i am using df command for finding the filesystem size and free space every hour. But how can i find the increase in size per hour? :rolleyes: Do i have to store the last hour entries in a file and comapre with... (2 Replies)
Discussion started by: kichu
2 Replies

8. Red Hat

Growing filesystem using LVM

Hi, I have a LUN presented to a Linux system and would like to ask if someone can advise if the logical volume /dev/mapper/VGOra-LVOra 12G 11G 659M 95% /usr/app/oracle can be extended. Is there any free space to allocate.... The LUN (25G) has been configured as follows: LUN - ROOT...... (4 Replies)
Discussion started by: jamba1
4 Replies

9. AIX

/usr is growing fast

I'm having a strange Phenomenon here in one of my servers /usr file system is growing fast and it went wild. I have searched the entire file system for large , growing and newly created files with no clue what's going on I have found nothing strange. Any further idea a snapshot from df's ... (4 Replies)
Discussion started by: h@foorsa.biz
4 Replies

10. AIX

Help growing fs

Hello, I have a filesystem that I'm trying to grow but it's giving me the error: 0516-404 allocp: This system cannot fulfill the allocation request. There are not enough free partitions or not enough physical volumes to keep strictness and satisfy allocation requests. The... (5 Replies)
Discussion started by: bbbngowc
5 Replies
PARSE_TIME(3)						   BSD Library Functions Manual 					     PARSE_TIME(3)

NAME
parse_time, print_time_table, unparse_time, unparse_time_approx, -- parse and unparse time intervals LIBRARY
The roken library (libroken, -lroken) SYNOPSIS
#include <parse_time.h> int parse_time(const char *timespec, const char *def_unit); void print_time_table(FILE *f); size_t unparse_time(int seconds, char *buf, size_t len); size_t unparse_time_approx(int seconds, char *buf, size_t len); DESCRIPTION
The parse_time() function converts a the period of time specified in into a number of seconds. The timespec can be any number of <number unit> pairs separated by comma and whitespace. The number can be negative. Number without explicit units are taken as being def_unit. The unparse_time() and unparse_time_approx() does the opposite of parse_time(), that is they take a number of seconds and express that as human readable string. unparse_time produces an exact time, while unparse_time_approx restricts the result to only include one units. print_time_table() prints a descriptive list of available units on the passed file descriptor. The possible units include: second, s minute, m hour, h day week seven days month 30 days year 365 days Units names can be arbitrarily abbreviated (as long as they are unique). RETURN VALUES
parse_time() returns the number of seconds that represents the expression in timespec or -1 on error. unparse_time() and unparse_time_approx() return the number of characters written to buf. if the return value is greater than or equal to the len argument, the string was too short and some of the printed characters were discarded. EXAMPLES
#include <stdio.h> #include <parse_time.h> int main(int argc, char **argv) { int i; int result; char buf[128]; print_time_table(stdout); for (i = 1; i < argc; i++) { result = parse_time(argv[i], "second"); if(result == -1) { fprintf(stderr, "%s: parse error ", argv[i]); continue; } printf("-- "); printf("parse_time = %d ", result); unparse_time(result, buf, sizeof(buf)); printf("unparse_time = %s ", buf); unparse_time_approx(result, buf, sizeof(buf)); printf("unparse_time_approx = %s ", buf); } return 0; } $ ./a.out "1 minute 30 seconds" "90 s" "1 y -1 s" 1 year = 365 days 1 month = 30 days 1 week = 7 days 1 day = 24 hours 1 hour = 60 minutes 1 minute = 60 seconds 1 second -- parse_time = 90 unparse_time = 1 minute 30 seconds unparse_time_approx = 1 minute -- parse_time = 90 unparse_time = 1 minute 30 seconds unparse_time_approx = 1 minute -- parse_time = 31535999 unparse_time = 12 months 4 days 23 hours 59 minutes 59 seconds unparse_time_approx = 12 months BUGS
Since parse_time() returns -1 on error there is no way to parse "minus one second". Currently "s" at the end of units is ignored. This is a hack for English plural forms. If these functions are ever localised, this scheme will have to change. HEIMDAL
October 31, 2004 HEIMDAL
All times are GMT -4. The time now is 01:35 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy