Sponsored Content
Full Discussion: Grep files older than 1 day
Top Forums Shell Programming and Scripting Grep files older than 1 day Post 302868743 by Daniel Gate on Monday 28th of October 2013 04:38:34 PM
Old 10-28-2013
Grep files older than 1 day

I thought that this would work for grep'ing files older than 1 day.
HTML Code:
ps -o etime,pid,user,args -e|awk '/^[0-9]+-/'|sort -t- -n -k 1,1 |grep qdaemon |grep /usr/bin/ksh
But, it is not grep'ing any of files (i.e. below) older than 1 day.

HTML Code:
  d_prod 33757970 61999560   0   Oct 27      -  0:00 /usr/lib/lpd/piobe -d s /var/spool/qdaemon/t__byia 
  d_prod 33823732 64297016   0   Oct 27      -  0:00 /usr/lib/lpd/pio/etc/piohpnpf -x umhn-gw45e-ps1 -p 9100 
  d_prod 33954782        1   0   Oct 22      -  0:00 /usr/lib/lpd/pio/etc/piohpnpf -x iphb-4h16-ps1 -p 9100 
  d_prod 34020298 20388700   0   Oct 27      -  0:00 /usr/lib/lpd/pio/etc/piohpnpf -x umhs-5picu-ps3 -p 9100 
  d_prod 34216790        1   0   Oct 25      -  0:00 /usr/lib/lpd/pio/etc/piohpnpf -x 10.2.4.14 -p 9100 
  d_prod 34282318        1   0   Oct 19      -  0:01 /usr/lib/lpd/pio/etc/piohpnpf -x 10.2.4.14 -p 9100 
  d_prod 35789678        1   0   Oct 18      -  0:01 /usr/lib/lpd/pio/etc/piohpnpf -x 10.1.2.147 -p 9100 
  d_prod 36117352        1   0   Oct 14      -  0:01 /usr/lib/lpd/pio/etc/piohpnpf -x stt-t6s22-ps1 -p 9100 
  d_prod 36445134        1   0   Oct 13      -  0:01 /usr/lib/lpd/pio/etc/piohpnpf -x stt-3n12-ps1 -p 9100 
  d_prod 36576086 55054126   0   Oct 18      -  0:00 /usr/lib/lpd/pio/etc/pioout -A0 -B33431 -C14688 -F\14\15 
  d_prod 36772662 43260322   0   Oct 24      -  0:00 /usr/lib/lpd/pio/etc/pioout -A0 -B34448 -C14688 -F\14\15 
  d_prod 36969394        1   0   Oct 25      -  0:00 /usr/lib/lpd/pio/etc/piohpnpf -x umhs-6d04-ps1 -p 9100 
  d_prod 37166000        1   0   Oct 26      -  0:00 /usr/lib/lpd/pio/etc/piohpnpf -x umhs-7c02-ps1 -p 9100 
  d_prod 37296914        1   0   Oct 25      -  0:00 /usr/lib/lpd/piobe -d s /var/spool/qdaemon/t__gxUa 
Please advise.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Deleting / finding files older than X days missess a day

Hi When trying to find and delete files which are, say, 1 day, the find command misses a day. Please refer the following example. xxxd$ find . -type f -ctime +1 -exec ls -ltr {} \; total 64 -rw-rw-r-- 1 oracle xxxd 81 Apr 30 11:25 ./ful_cfg_tmp_20080429_7.dat -rw-rw-r-- 1... (4 Replies)
Discussion started by: guruparan18
4 Replies

2. Shell Programming and Scripting

Listing processes that are a day older

Hi All, I am trying to automate some stuff to make my 'to-do-things' easier. I am in need for help regarding this. I have an output root 17187 3465 0 23:00:00 ? 0:01 Process1 root 4975 4974 0 May 12 ? 0:00 Process2 root 4042 16713 0 Jan 30 pts/22 0:00... (4 Replies)
Discussion started by: reddybs
4 Replies

3. Shell Programming and Scripting

Find the number of files older than 1 day from a dir

Hello All, I need to write a script/command which can find out the number of .csv files residing in a directory older than 1 day. The output should come with datewise (means for each date how many files are there). I've this command, but this command gives the total number of files. It's... (10 Replies)
Discussion started by: NARESH1302
10 Replies

4. Shell Programming and Scripting

how to delete the older files other than the recently added 5 files

Number of files will get created in a folder automatically daily.. so i hav to delete the older files other than the recently added 5 files.. Could u help me through this..?? (5 Replies)
Discussion started by: shaal89
5 Replies

5. UNIX for Dummies Questions & Answers

Move the files between Current day & a previous day

Hi All, I have a requirement where I need to first capture the current day & move all the files from a particular directory based on a previous day. i.e move all the files from one directory to another based on current day & a previous day. Here is what I am trying, but it gives me errors.... (2 Replies)
Discussion started by: dsfreddie
2 Replies

6. Shell Programming and Scripting

How archive the older than 30 day files to another unix server

I need to archive the older than 30 day file to another uinx server.I have wrote the below uinx script. for LOOK_DIR in /TempFiles do for FILE in `find ${LOOK_DIR} -mtime -30 -exec ls {} \;` do echo ${FILE} >> file_list ## This file will have the list of files copied and... (12 Replies)
Discussion started by: murari83.ds
12 Replies

7. Shell Programming and Scripting

Sftp - 1 day older files count

Need to write a shell script on AIX box which will connect to different servers using SFTP and get the file count of only 1 day older files. (purging list) How to achieve this? On local server we can use: find <path> -type f -mtime +1 But how to do it in case of SFTP? Please advise. Thanks... (9 Replies)
Discussion started by: vegasluxor
9 Replies

8. Shell Programming and Scripting

How to create zip/gz/tar files for if the files are older than particular days in UNIX or Linux?

I need a script file for backup (zip or tar or gz) of old log files in our unix server (causing the space problem). Could you please help me to create the zip or gz files for each log files in current directory and sub-directories also? I found one command which is to create gz file for the... (4 Replies)
Discussion started by: Mallikgm
4 Replies

9. Shell Programming and Scripting

Find processes older than 1 day

// AIX 6.1 I need to extract PIDs of ps -ef |grep /usr/lib/lpd/pio | awk '{print $2}' ps -ef |grep qdaemon |grep /usr/bin/ksh | awk '{print $2}' that are older than 1 day. I know find . -type f -mtime +1, but it doesn't work for PIDs. Please let me know how to get the PIDs older than... (1 Reply)
Discussion started by: Daniel Gate
1 Replies

10. Shell Programming and Scripting

Delete all log files older than 10 day and whose first string of the first line is "MSH" or "<?xml"

Dear Ladies & Gents, I have a requirement to delete all the log files in /var/log/test directory that are older than 10 days and their first line begin with "MSH" or "<?xml" or "FHS". I've put together the following BASH script, but it's erroring out: for filename in $(find /var/log/test... (2 Replies)
Discussion started by: Hiroshi
2 Replies
PSF(8)							      System Manager's Manual							    PSF(8)

NAME
psf - PostScript filter SYNOPSIS
psf [ -n name ] [ -h host ] [ -w width ] [ -l length ] [ -i indent ] [ -c ] DESCRIPTION
psf is an lpd filter for PostScript printing. psf interprets the name it was called with to determine what filters to invoke. First, if the string ``pap'' appears anywhere in the name, psf invokes pap to talk to a printer via AppleTalk. Next, if the string ``rev'' appears, psf invokes psorder to reverse the pages of the job. Finally, if psf was called with a filter's name as the leading string, it invokes that filter. If there is no filter to run, psf examines the magic number of the input, and if the input is not PostScript, converts it to Post- Script. KLUDGE
In the default configuration, psf supports two kludges. The first causes psf to check its name for the letter `m'. If this letter is found and accounting is turned on, psf calls pap twice, once to get an initial page count and to print the job, and another time to get a final page count. This is a work-around for bugs in a variety of PAP implementions that cause printers to never properly close the PAP output file. A notable example is any printer by Hewlett-Packard. The second kludge causes psf to examine its name for the letter `w'. If this letter is found and accounting is turned on, psf calls pap with the -w flag. This flag causes pap to wait until the printer's status contains the string `idle'. Once this string is found, the job is printed as normal. This kludge is a work-around for printers, notably Hewlett-Packard's LaserJet IV, which will report a page count while a previous jobs is still printing. EXAMPLE
The sample printcap entry below invokes psf to print text files, PostScript files, troff's C/A/T output, and TeX's DVI output, to an AppleTalk connected LaserWriter Plus. Since the LaserWriter Plus stacks pages in descending order, we reverse the pages and print the burst page last. laser|lp|LaserWriter Plus on AppleTalk: :sd=/usr/spool/lpd/laser: :lp=/usr/spool/lpd/laser/null: :lf=/var/adm/lpd-errs:pw#80:hl: :of=/usr/lib/filters/ofpap: :if=/usr/lib/filters/ifpaprev: :tf=/usr/lib/filters/tfpaprev: :df=/usr/lib/filters/dfpaprev: Note that if the host in question spools to more than one AppleTalk printer, /dev/null should not be used for the lp capability. Instead, a null device should be created with mknod for each printer, as has been done above. Finally, there is a file in the spool directory, /var/spool/lpd/laser, called .paprc, which pap reads for the AppleTalk name of the printer. SEE ALSO
psorder(1), printcap(5), lpd(8), mknod(8), pap(8). netatalk 1.2 17 Dec 1991 PSF(8)
All times are GMT -4. The time now is 07:40 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy