3 - YADU, May/2001 - Alek Komarnitsky [<Prev][TOC][Next>]


            Some examples of using yadu
   
$/appl/yadu/yadu -examples   (program is "semi-self-documenting)
2003_03_12, Alek Komarnitsky, yadu README.examples
Here are some examples of using yadu for "interesting" things.
As with any tool, I'm sure there are other "cool" things one
can do ... so drop me an Email if you come up with some.
Note: It's assumed you are familiar with filesystem concepts.
You should also have the "-help" output available from the
various programs in front of you. And standard file permission
issues come into play ... so you may need to run yadu as root
in order to descend into directories.
As with any tool, **TRY IT** a few times ... and it will make
more sense in how to use it and where the output is to look at.
yadu has more options that you can "shake a stick" at ... but
once you get "into" this, there are funky things that you 
become aware of that might be interesting to look at.
1.  Generate yadu report to STDOUT for a specific user 
       $yadu /home/USERNAME
2.  Generate "parseable" report to STDOUT of files > 1 MBytes
       $yadu -parseable -way_to_big=1000000 /home/USERNAME
3.  Generate yadu report to STDOUT for all /vdisk* filesystems
       $yadu /vdisk*
4.  To generate same report, but log to files (more typical scenerio)
       $mkdir TMPDIR ; cd TMPDIR
       $yadu -log_to_files /vdisk*
       $ls reports (various report files in various categories)
5.  To generate same report, but log to files (more typical scenerio)
       $mkdir TMPDIR ; cd TMPDIR
       $yadu -log_to_files /vdisk*
       $ls reports (various report files in various categories)
6.  Generate seperate reports for each filesystem.
    Also see yadu_em_all.pl (this is semi-raw, so read the code carefully)
    Also see yadu_totals, which can combine these back together for you.
       $csh
       $mkdir TMPDIR ; cd TMPDIR
       $foreach i ( /vdisk* )
          $mkdir TMPDIR/$i ; cd TMPDIR/$i
          $yadu -log_to_files $i
       $end
       $ls TMPDIR/zzz*zzz/reports (various report files in various categories)
7.  Dump filenames by user for those filesystems 
       $mkdir TMPDIR ; cd TMPDIR
       $yadu -log_to_files -dump_breakdown=user /vdisk*
       $ls breakdown_by_filename/by_user 
8.  Dump filenames by ALL categories for those filesystems 
       $mkdir TMPDIR ; cd TMPDIR
       $yadu -log_to_files -dump_breakdown=ALL /vdisk*
       $ls breakdown_by_filename (sub-dirs of various categories)
9.  Do a "drilldown" for user XYZ (using data from example #7)
    Note the use of "-prune_dirs" which says if a directories is in the
    list of filenames to "yadu", do not descend into it ... this way we
    don't subsequently double-count anything when a file inside of that
    directory is listed. 
       $mkdir TMPDIR2 ; cd TMPDIR2
       $yadu -prune_dirs -log_to_files -dump_breakdown=ALL -input_from_file TMPDIR/breakdown_by_filename/by_user/USERXYZ
       $ls reports (for summary reports on user XYZ)
       $ls breakdown_by_filename (for path listing in various categories)
10. Do a "drilldown" for all .MP3 files (using data generated in example #7)
       $mkdir TMPDIR2 ; cd TMPDIR2
       $yadu -prune_dirs -log_to_files -dump_breakdown=ALL -input_from_file TMPDIR/breakdown_by_filename/by_ext/.MP3
       $ls reports (for summary reports for all .MP3 files) 
       $ls breakdown_by_filename (for path listing in various categories)
11. Generate a seperate yadu report for each user (using data from example #7)
       $csh
       $mkdir TMPDIR2 ; cd TMPDIR2
       $foreach i ( TMPDIR/breakdown_by_filename/by_user
breakdown_by_filename/by_atime/1* 
          Will list those "users" who have accessed their files recently.
          "prune" this list ... and then do a "2*" (and so on) to "group"
          users by categories of last accessed file.
        Some examples of using the yadu "utility" programs
A.  Combine reports of all /vdisk* yadu reports from example #4. 
    $cd TMPDIR
    $yadu_totals vdisk*
    $more yadu.status (see one-line summary total per vdisk*)
    $ls reports (summary reports totalling all data from vdisk*) 
    
B.  Show users who own files on >=3 /vdisk filesystems from example #4.
    $cd TMPDIR
    $yadu_dups -show_dups=3 vdisk*/reports/report.by.gcos
    
C.  Take (possibly) lengthy report.by.user and show top-20 using data from #3.
    $cd TMPDIR/reports
    $yadu_grouper report.by.user
D.  Take (possibly) lengthy report.by.ext and apply various grouping rules
    and show top-20 by extension using data from #3.
    $cd TMPDIR/reports
    $yadu_grouper report.by.ext