Sponsored Content
Top Forums Shell Programming and Scripting Find the sum of files created 5 days before Post 302594847 by methyl on Wednesday 1st of February 2012 10:42:43 AM
Old 02-01-2012
@jim@mcnamara
Block size in HP-UX is 512 bytes.

Not sure that "find" works because the two "-mtime" values are convergent.
Maybe you meant:
Code:
find /path/to/files -type f \( -mtime -6 -a ! -mtime -5 \)      ...

This will still give different results depending on what time of day it is run.

@bang_dba
Post is really ambiguous. Please explain and give examples with real dates of what files are included in the query (including examples of large files and of files created at various times of the day). Please also explain what it is you want to "sum".
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Deleting files created before two days ago

Dear All: I want to build a shell that delete files created two or more days ago ... I think it could be built using a special command with ls or grep, I'd apreciate any help from you guys I have a lot of log files from november, december, january and this tool will help me a lot The files... (3 Replies)
Discussion started by: josecollantes
3 Replies

2. Shell Programming and Scripting

Find files older than 20 days & not use find

I need to find files that have the ending of .out and that are older than 20 days. However, I cannot use find as I do not want to search in the directories that are underneath the directory that I am searching in. How can this be done?? Find returns files that I do not want. (2 Replies)
Discussion started by: halo98
2 Replies

3. Shell Programming and Scripting

List files created before Noon 2 days prior

Our nightly updates run in the evening and finish around 8am. My boss wants the current log files kept on the server for 2 days, but wants anything created before noon, 2 days prior archived. I was thinking of using touch to set a temporary file with a date of today-2 and a time of noon, then... (3 Replies)
Discussion started by: prismtx
3 Replies

4. Shell Programming and Scripting

Remove files which created date before 10 days on HP-UX

Hi All, Could you please let me know if there is any one can help to create a shell script to remove some files which is the created date for them greate than 10 days (sysdate-10) Please try to email me on email removed Thanks in advance, Murad (1 Reply)
Discussion started by: murad_fayez
1 Replies

5. Shell Programming and Scripting

Find the directory modified/created before 4 days

Hi, I have an application which creates some directories while running. I want to delete these directories which are 4 days older. i tried find . type d -mtime +1 -print And it is working fine.. but find . type d -mtime +4 -print is not giving any results which are 4 days... (6 Replies)
Discussion started by: Tuxidow
6 Replies

6. Shell Programming and Scripting

find files created within 30 minutes

find . -name *.txt -mmin -30 This is working in Redhat but not in Solaris.. What is the equivalent option in Solaris? (1 Reply)
Discussion started by: tene
1 Replies

7. Shell Programming and Scripting

Find directories only and delete them created 3 days before

Hello I have some directories and files created under /export/local/user I would like to delete directories only under /export/local/user, created before 3 days Can someone help me with command to do this task? Thanks (4 Replies)
Discussion started by: needyourhelp10
4 Replies

8. UNIX for Dummies Questions & Answers

How to find files created some days before?

HI, I have 2 questions. 1> Is there any code to see files that created some day or some time before in a directory??? 2> how or where i will find the last exit status of a process?? thanks (6 Replies)
Discussion started by: jyotidas
6 Replies

9. Shell Programming and Scripting

Find unix file created how many days ago?

i want to find unix file created how many days ago? (4 Replies)
Discussion started by: utoptas
4 Replies

10. Shell Programming and Scripting

what is the find to command to find the files created last 30 days

what is the find to command to find the files created last 30 days (5 Replies)
Discussion started by: rajkumar_g
5 Replies
tar(5)								File Formats Manual							    tar(5)

Name
       tar, mdtar - tape archive file format

Description
       The tape archive command dumps several files, including special files, into one, in a medium suitable for transportation.

       A  tape or file is a series of blocks.  Each block is of size TBLOCK.  A file on the tape is represented by a header block, which describes
       the file, followed by zero or more blocks, which give the contents of the file.	At the end of the tape are two blocks filled  with  binary
       zeros, as an end-of-file indicator.

       The  blocks  are  grouped  for  physical I/O operations.  Each group of n blocks (where n is set by the option on the command line, and the
       default is 20 blocks) is written with a single system call; on 9-track tapes, the result of this write is a single tape record.	 The  last
       group  is  always  written at the full size, so blocks after the two zero blocks contain random data.  On reading, the specified or default
       group size is used for the first read, but if that read returns less than a full tape block, the reduced block size  is	used  for  further
       reads.

       The following is an example of a header block:
       #define TBLOCK  512
       #define NAMSIZ  100

       union hblock {
	       char dummy[TBLOCK];
	       struct header {
		       char name[NAMSIZ];
		       char mode[8];
		       char uid[8];
		       char gid[8];
		       char size[12];
		       char mtime[12];
		       char chksum[8];
		       char linkflag;
		       char linkname[NAMSIZ];
		       char rdev[6]
	       } dbuf;
       };

       The  name  field  is  a	null-terminated string.  The other fields are 0-filled octal numbers in ASCII.	Each field (of width w) contains w
       minus 2 digits, a space, and a null, except size and mtime , which do not contain the trailing null.  The name field specifies the name	of
       the  file,  as  specified  on  the command line.  Files dumped because they were in a directory that was named in the command line have the
       directory name as prefix and /filename as suffix.  The field specifies the file mode, with the top bit masked off.  The uid and gid  fields
       specify	the  user  and group numbers that own the file.  The size field specifies the size of the file in bytes.  Links and symbolic links
       are dumped with this field specified as zero.  The mtime field specifies the modification time of the file at the time it was dumped.   The
       chksum  field  is a decimal ASCII value, which represents the sum of all the bytes in the header block.	When calculating the checksum, the
       chksum field is treated as if it were all blanks.  The linkflag field is ASCII 0 if the file is normal or a special file and ASCII 1 if	it
       is  a  hard  link,  and	ASCII  2  if it is a symbolic link.  The name to which it is linked, if any, is in linkname, with a trailing null.
       Unused fields of the header are binary zeros and are included in the checksum.  The rdev field encodes the ASCII representation of a device
       special file's major and minor device numbers.

       The  first  time  a given i-node number is dumped, it is dumped as a regular file.  The second and subsequent times, it is dumped as a link
       instead.  Upon retrieval, if a link entry is retrieved, but not the file it was linked to, an error message is printed and the tape must be
       manually rescanned to retrieve the linked file.

       The encoding of the header is designed to be portable across machines.

Restrictions
       Names or link names longer than NAMSIZ produce error reports and cannot be dumped.

See Also
       tar(1)

																	    tar(5)
All times are GMT -4. The time now is 01:28 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy