Sponsored Content
Top Forums Shell Programming and Scripting How to pick only the files which are generated in one hour? Post 302769210 by DGPickett on Monday 11th of February 2013 02:18:01 PM
Old 02-11-2013
Touch two files with the right times and "find ... -type f -newer low_time ! -newer high_time"?
This User Gave Thanks to DGPickett For This Post:
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

How to list all the files which are not generated today

How to list all the files which are not generated today, and move all the above files to backup dir. (2 Replies)
Discussion started by: redlotus72
2 Replies

2. Shell Programming and Scripting

Ftp all the generated files

Hi All, I'm working on a ftp shell script in which I'm tranfering files from one sever to another using ftp. Some program generates files at undefined time & throughout the day. I have to transfer the files time to time.. i.e. once the file is generated, it should be transfered at the very... (3 Replies)
Discussion started by: im_new
3 Replies

3. UNIX for Advanced & Expert Users

Type v for generated files

Hi All, I was checking some of the files and I got the following entries:- =============== v, 664, serv, serv, version.txt, exe L, 775, serv, serv, start.sh, eventserv ================ Could someone please tell me what does the type"v" and "L" represent to. I have not... (2 Replies)
Discussion started by: shubhranshu
2 Replies

4. Shell Programming and Scripting

need to pick out files which are not of zero bytes

I need a scriptto print only those files from a list of files starting with STMT* which are not of zero bytes ...i.e they have some size if these are the files 631 -rw-r--r-- 1 assrisa assrisa 39099 Aug 19 07:16 STMT_05_D1090819_T071320 -rw-r--r-- 1 assrisa assrisa 0 Aug 19... (2 Replies)
Discussion started by: viv1
2 Replies

5. Solaris

core files not getting generated

Hi, We have an application ASPA . The application related processes are running in /ASPA/bin directory . now whenever a process terminates abruptly , a core file should be generated (correct me if i am wrong) in the /ASPA/bin directory . But i am not able to see any such files . The... (4 Replies)
Discussion started by: asalman.qazi
4 Replies

6. Shell Programming and Scripting

Getting list of files generated last 10 seconds

I was trying to figure out in Korn shell but this may apply elsewhere how to generate a list of files from a directory created in the last 10 seconds or less. I have used the find command in the past with -mtime which is measured in days to get a list of files older than say 7 days for example. ... (1 Reply)
Discussion started by: lee_murray
1 Replies

7. Shell Programming and Scripting

Files generated by a particular user

Hi I have the following files generated by different users on a directory -rw-rw-r-- 1 NAME1 database03 809 Nov 17 10:41 PCAS_CARD_TRANS_OFF.1111171041.lg -rw-rw-r-- 1 richard ccsdba 10968411 Nov 17 10:43 load_123_RX0_0.1111171016.lg -rw-rw-r-- 1 DEV db03 10713 Nov 17... (5 Replies)
Discussion started by: bobby1015
5 Replies

8. Shell Programming and Scripting

Files generated today

I would like to find the Files which are generated today in the current directory: I use the commad ls -lrt * | egrep " `date "+%b"` * `date "+%d"` to acheive this. Is there any better way to acquire the same. Multiple answers will be great. Thanks (3 Replies)
Discussion started by: kusathy
3 Replies

9. Shell Programming and Scripting

How to tail real time file Generated every hour?

Hi Guys, I am developing a script to monitor log file Generated every hour. When creating a new file scripts not working. My Code . I want to monitor GatewayTransaction.yyyymmdd-hh.log while true; do newdate=$(date '+%Y%m%d') ; nowdate=$(date '+%Y%m%d-%H.log'); tail -f... (7 Replies)
Discussion started by: ooilinlove
7 Replies

10. Shell Programming and Scripting

Pick the last one hour lines from log matching this pattern.

Hello please help me on this, pick the last one hour lines from the log, which have the prefix time format like this. log message log message i tried to do grep, but that failed. my code grep '(date +)' log_file_path This checking only the current time stamp. How to get the log... (16 Replies)
Discussion started by: santosh2626
16 Replies
cpio(1) 						      General Commands Manual							   cpio(1)

Name
       cpio - copy file archives in and out

Syntax
       cpio -i [ -C ] [keys] [patterns]

       cpio -o [keys]

       cpio -p [keys] directory

Description
       The  command  is  a filter designed to let you copy files to or from an archive.  The command differs from the command in that lets you ar-
       chive any kind of file, while is limited to program object files.

Options
       -i   Copies files that match the specified pattern.  If the pattern is not specified, copies in all files.  Extracts files from	the  stan-
	    dard  input,  which  is  assumed to be the product of a previous cpio -o, and places them into the user's current directory tree.  For
	    files with the same name, the newer file replaces the older file unless the -u option is used.

	    Only files with names that match patterns are selected.  The patterns are specified using the notation for names described in In  pat-
	    terns,  the  slash	for  directories (/) is included in searches using meta-characters.  For example, suppose the archive contains the
	    file and the pathname information in the archive indicates that the directory below contains the file This command copies  both  files
	    into the user's current directory:
	    cpio -i *p < /dev/rmt0l

	    Multiple  patterns	may be specified and if no patterns are specified, the default for patterns is * (that is, select all files).  The
	    extracted files are conditionally created and copied into the current directory tree based upon the options described below.  The com-
	    mand has three function keys, each with its own set of options.

       -C   Specifies  compatability mode for reading archives created with the old style header format.  Use this option to copy in archives gen-
	    erated by pre-V4.2 This option is valid only for copy-in (-i) operations.

       -o   Copies out the specified files.  Reads the standard input to obtain a list of path names and copies those files onto the standard out-
	    put together with path name and status information.

       -p   Copies  files  into  the specified destination directory, which must already exist.  Reads the standard input to obtain a list of path
	    names of files that are conditionally created.  This list of files is copied into  the  destination  directory  tree  based  upon  the
	    options used.  For files with the same name, the newer file replaces the older file unless the -u option is used.

Keys
       6    Processes a file with the UNIX System Sixth Edition format.

       a    Retains  original  access  times  of  input  files, and can be used with -o and -p.  Normally, the read(s) used in the copy update the
	    copied file's access time.

       B    Determines input/output is to be blocked 5,120 bytes to the record.  This option is meaningful only with data directed to or from or

       b    Swaps both bytes and halfwords.

       c    Creates header information in ASCII format and can be used with -i and -o.

       d    Creates subdirectories, as needed, below the specified destination directory.

       f    Copies all files except those that match the specified pattern.

       k    Enables symbolic link handling and is used with the -i, -o, and -p options.

       l    Creates links wherever possible.

       m    Retains modification time for each copied file.  This option does not work on directories or symbolic links that are being copied; the
	    directory is always reset to show the access time when the copy was made.

       r    Interactively renames files.  If you respond with a null line, the file is skipped (not copied).  Use only with the -i option.

       s    Swaps bytes while copying files in.

       S    Swaps half words while copying files in.

       t    Prints a table of contents of the input (no files are created).

       u    Copies files unconditionally.  (Otherwise, an older file will not replace a newer file with the same name).

       v    Displays  detailed	(verbose)  information as it copies and/or creates file.  When used with the t option, the table of contents looks
	    like the output of an ls -l command.  For further information, see

Examples
       This example shows how to copy the contents of the user's current directory into an archive.
       ls | cpio -o  > /dev/rmt0l
       This example shows how to duplicate a directory hierarchy.
       mkdir ~phares/newdir
       cd ~phares/olddir
       find . -print | cpio -pdl ~phares/newdir
       This example shows how to copy all files and directories with names containing the characters "chapter" in user smith's home directory  and
       underlying directories.
       find ~smith -name '*chapter*' -print | cpio -o > /dev/rmt0h
       This example shows the results of using the r option with the -i function key.
       ls | cpio -ir > ~smith/newdir
       Rename <file1>
       newnamefile1
       Rename <file2>
       <RETURN>
       Skipped
       Rename <file3>
       newnamefile3
       In  some  cases,  the  -cpio  option of the command can be used more effectively than pipes and redirects using For instance, the following
       example
       find . -print | cpio -oB > /dev/rmt0l
       can be handled more efficiently by:
       find . -cpio /dev/rmt0l
       To copy the contents of a directory (with symbolic link handling enabled) to the tape drive, type:
       ls | cpio -ok > /dev/rmt0h
       To restore the archived files back into a directory, type:
       cpio -ik < /dev/rmt0h
       The following example moves files, including symbolic links, from an old directory to a new directory:
       mkdir ~craig/newdir
       cd ~craig/olddir
       ls | cpio -pdk ~craig/newdir

Restrictions
       Pathnames are restricted to 128 characters.

       When there are too many unique linked files, the program runs out of memory and cannot trace them.  In this case,  linking  information	is
       lost.

       Only the superuser can copy special files.

See Also
       ar(1), find(1), cpio(5)

																	   cpio(1)
All times are GMT -4. The time now is 12:12 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy