home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / unix / admin / 6348 < prev    next >
Encoding:
Text File  |  1992-11-23  |  2.7 KB  |  70 lines

  1. Newsgroups: comp.unix.admin
  2. Path: sparky!uunet!boulder!colorado.edu!ejh
  3. From: ejh@khonshu.colorado.edu (Edward J. Hartnett)
  4. Subject: Re: problems with a find command (SUMMARY)
  5. In-Reply-To: mbarkah@slate.mines.colorado.edu's message of 23 Nov 92 17:56:01 GMT
  6. Message-ID: <EJH.92Nov23150526@khonshu.colorado.edu>
  7. Sender: news@colorado.edu (The Daily Planet)
  8. Nntp-Posting-Host: khonshu.colorado.edu
  9. Organization: CIRES, University of Colorado
  10. References: <EJH.92Nov23085733@khonshu.colorado.edu>
  11.     <1992Nov23.175601.54551@slate.mines.colorado.edu>
  12. Date: 23 Nov 92 15:05:26
  13. Lines: 55
  14.  
  15. In article <1992Nov23.175601.54551@slate.mines.colorado.edu> mbarkah@slate.mines.colorado.edu (Ade Barkah) writes:
  16.  
  17.    ejh@khonshu.colorado.edu (Edward J. Hartnett) writes:
  18.    : I put a find command in my crontab file which I hoped would compress
  19.    : files larger than 10 megabytes which haven't been accessed for 14
  20.    : days. But here's what I got in my mail about it:
  21.    : Your "cron" job
  22.    : 
  23.    : /usr/bin/find / -size 1000000c -atime +14 -exec compress {}\;
  24.    : ...
  25.    : It looks like a good command to me! Can anyone help?
  26.  
  27.    You need a space between {} and \;. Do:
  28.  
  29.    /usr/bin/find / -size 10000000c -atime +14 -exec compress {} \;
  30.  
  31.    or
  32.  
  33.    /usr/bin/find / -size 10000000c -atime +14 -print | xargs compress
  34.  
  35. I used the first one.
  36.  
  37.    Also make sure that the size is 10mb, not 1mb as you have it. You'd
  38.    be in for a big surprise.
  39. Yes, I knew it was 1 MB, I just wrote 10 by mistake. Also, as someone
  40. here suggested, I changed it to +10000000c so that it would catch
  41. files greater than 1 MB too.
  42.  
  43.    Also, I'm not sure if running it recursive from the root directory
  44.    is a good idea. You might just accidentally compress some systems
  45.    file. In fact, it might not be a good idea doing anything of the
  46.    sort.
  47. This is a good point and in fact, by the time I posted it I had
  48. already reconsidered. I now do two fnds, one for /data (a partition
  49. strictly for data) and /home/khonshu (user accounts - also with lots
  50. of data files). This way it won't go near any of my system files.
  51.  
  52.    An alternative would be to print out user files with the above
  53.    specifications, then ask the user to either remove it or compress
  54.    it if possible. Auto compress might just zap a poor user's datafile.
  55.    (say, if he has something which updates the datafile monthly, and
  56.    has been doing so for the last five years...) You be the judge.
  57. Yes, good idea, but in this case there are only three users, and I'm,
  58. by far, the most active, so it's no problem to just compress them. 
  59.  
  60.  
  61.    -Ade.
  62.    -- 
  63.    Internet  : mbarkah@slate.mines.colorado.edu    (NeXT Mailable)
  64.    CompuServe: 74160,3404
  65. --
  66.     Don't blame me, I voted against Amendment 2!
  67.  
  68. Edward Hartnett                ejh@khonshu.colorado.edu
  69.  
  70.