DUREP(1)

πŸ“¦
version 0.9 Β· 3 versions
, in debian bookworm, ubuntu jammy, ubuntu noble

πŸ’– DUREP(1) β€” Disk Usage Report Generator πŸ’–

okay bestie, welcome to the manual for durep, and yes it's the Disk Usage Report Generator section of your friendly neighbourhood manual pages. buckle up, we're gonna find out who's been eating your disk. πŸ“


✨ NAME ✨

durep β€” disk usage report generator. that's it, that's the name, iconic.


🌸 SYNOPSIS 🌸

durep [OPTIONS]... [DIRECTORY]

πŸ¦‹ DESCRIPTION πŸ¦‹

so like, durep creates disk usage reports with bar graphs, which means you can look at it and instantly go "oh. that's the directory hoarding all my space." no detective work required, the graph just tells you. πŸ’…

and yeah, technically durep can produce text output that looks a lot like du β€” sure, fine, whatever β€” but its real power is that it can store reports in a file, and then you view that file as a web page with the supplied cgi script. that's the main character energy right there. πŸ‘‘


πŸ’œ OPTIONS πŸ’œ

the options are grouped into three distinct sections, keep up bestie:

πŸ“ Text Output Options

these ones control the text report output.

  • -td, --text-depth=N β€” limits the text report on directories to depth N. no directories below this level show up in the report. like a lil ceiling for your tree. 🏠
  • -hs, --hide-size=N[bkmg] β€” do not display entries using N Bytes/KB/MB/GB or less (default is Bytes). it's for reducing clutter in the reports β€” lets you yeet small files out of the text report. βœ‚οΈ
  • -sd, --show-date β€” display the modification date of the file or directory in the report. timestamps, bestie. πŸ“…
  • -ns, --nosort β€” do not sort results by size. leaves results in the order in which they were scanned, which is highly dependent on the file system. chaos mode, lowkey. πŸ™ˆ
  • -q, --quiet β€” do not produce text output. this stops the creation of a text report, and it's super useful when you're only interested in generating a save-file for use with the web report. shhh. 🀫

πŸ’Ύ File Options

these control load and save files.

  • -sf, --save-file=FILE β€” save the results of the scan into this file. it can be loaded for a text report, but it's generally used by the cgi script to display web reports. the filename should end in .ds (it gets appended if it doesn't). no -sf file left behind without its lil extension. πŸŽ€
  • -lf, --load-file=FILE β€” load the results of a scan from this file. this takes the place of scanning a directory. heads up: inclusion options (described below) will not take effect if this option is used. 🫢
  • -d, --desc=DESCRIPTION β€” give a description to be stored in the save-file. this is displayed on the web report summary page. give your report a lil personality. ✨
  • -c, --collate==DIR β€” collate the save-files in the given directory. this creates a durep.cds file, which is used by the cgi script to manage and display save-files. see the Web Reports section below for more detail. πŸ—‚οΈ

🚫 Inclusion Options

these control which directories and files should be included in the report.

  • -f, --files β€” do not descend into sub-directories, only report files. stay on the surface, bestie. 🌊
  • -x, --one-file-system β€” do not traverse file systems. this is similar to the -x option for du, allowing easy checking of an entire file system such as /. one file system and one file system only. 🚧
  • -cp, --collapse-path=PATTERN β€” hide entries below paths that match PATTERN. this lets you conceal the contents of certain directories in the report. say you wanna show home directories in a report but not show their content β€” in which case you could use the option "-cp '/home'". sneaky but legal. πŸ•΅οΈ
  • -ep, --exclude-path=PATTERN β€” ignore paths that match PATTERN. works in a similar manner to "-cp" above, except it excludes the directory from the scan itself. not just hidden β€” never even invited. πŸ’€
  • -cf, --coalesce-files==N[bkmg] β€” coalesces entries for files below the given size into one entry. useful for reducing clutter in reports. all the small fries get merged into one lil nugget. 🍟

🌈 WEB REPORTS 🌈

since version 0.9, durep no longer directly generates html files for its web reports. instead it uses a cgi script that reads data from save-files. the script will handle multiple save-files, potentially from multiple hosts, so you can consolidate your reports into one place. copying save-files from other hosts is left as an exercise for the reader. (translation: you're on your own for that part, bestie 😭)

it is necessary to collate the save-files before viewing them via the cgi script. this process creates the file "durep.cds" which contains meta-data about all of the save-files. from this a summary page is shown where you can choose which report you wish to view. the collation must be done any time a save-file is added or overwritten. every single time. no skipping. ⭐

the cgi-script has some configurable variables at the top. these tell the script where to look for the css file and the graphic used for the bar graphs. there are also options to set whether the modification date, and/or the options used to create the save-file should be shown. these are both set to 1 by default. πŸŽ›οΈ

as always, you should take care when installing the cgi script. I've done my best, but I make no guarantees about its security. it would probably be unwise to allow this script to be accessed from the Internet at large. πŸ”₯ please be safe out there.

πŸŽ€ EXAMPLES πŸŽ€

  1. durep -td 2

this would print the directory tree starting from the current directory to depth 2. short and sweet.

  1. durep -f /var/spool/mail

this might be useful for keeping a check on the mail directory. the "-f" switch tells durep to just scan files and not descend into directories.

  1. durep -x -cp "/(etc|usr/share)" -ep "/var" -sf /var/lib/durep/root.ds /

this more complicated version does the following. it scans the root file system only, collapses the contents of any paths beginning /etc or /usr/share and skips the contents of the /var directory. it saves the output of this report into the file /var/lib/durep/root.ds. no text report is produced. the full combo meal. πŸ”

  1. durep -lf /var/lib/durep/root.ds -hs 1m

this reads the save-file /var/lib/durep/root.ds and produces a text report from it, hiding any files below 1 megabyte. bye bye small files. πŸ‘‹

  1. durep -c /var/lib/durep

this collates any save-files in /var/lib/durep.


πŸ‘€ SEE ALSO πŸ‘€

du(1), perl(1)


πŸ’– AUTHOR πŸ’–

Damian Kramer <psiren@hibernaculum.net>


okay that's the whole page bestie, you're officially a durep expert now, no cap. 🫢✨

this was durep version 0.9, dated 2021-01-03 β€” go forth and find out what's eating your disk, mwah πŸ’…πŸŽ€

πŸ“¦ where this page comes from