├── .gitignore
├── .travis.yml
├── ChangeLog
├── INSTALL
├── LICENSE
├── Makefile.am
├── README.md
├── TODO.md
├── build
├── README.md
└── duc.spec
├── configure.ac
├── debian
├── changelog
├── compat
├── control
├── copyright
├── duc-nox.examples
├── duc-nox.install
├── duc-nox.links
├── duc-nox.manpages
├── duc.examples
├── duc.install
├── duc.manpages
├── rules
├── source
│ └── format
└── watch
├── doc
├── Makefile
├── duc.1
├── duc.1.html
├── duc.md
└── manual.txt
├── examples
├── duc.css
├── ducrc
├── footer.htm
├── header.htm
└── index.cgi
├── gentoo
├── duc-1.4.1.ebuild
├── duc-9999.ebuild
└── metadata.xml
├── img
├── duc.png
├── example.png
├── fuzz-off.png
├── fuzz-on.png
├── palette-greyscale.png
├── palette-monochrome.png
├── palette-rainbow.png
├── palette-size.png
└── ui.png
├── src
├── duc
│ ├── cmd-cgi.c
│ ├── cmd-graph.c
│ ├── cmd-gui.c
│ ├── cmd-guigl.c
│ ├── cmd-histogram.c
│ ├── cmd-index.c
│ ├── cmd-info.c
│ ├── cmd-json.c
│ ├── cmd-ls.c
│ ├── cmd-topn.c
│ ├── cmd-ui.c
│ ├── cmd-xml.c
│ ├── cmd.h
│ ├── ducrc.c
│ ├── ducrc.h
│ └── main.c
├── glad
│ ├── KHR
│ │ └── khrplatform.h
│ ├── glad.c
│ └── glad
│ │ └── glad.h
├── libduc-graph
│ ├── duc-graph.h
│ ├── font.c
│ ├── graph-cairo.c
│ ├── graph-html.c
│ ├── graph-opengl.c
│ ├── graph-private.h
│ ├── graph-svg.c
│ └── graph.c
└── libduc
│ ├── buffer.c
│ ├── buffer.h
│ ├── canonicalize.c
│ ├── db-kyoto.c
│ ├── db-leveldb.c
│ ├── db-lmdb.c
│ ├── db-sqlite3.c
│ ├── db-tkrzw.c
│ ├── db-tokyo.c
│ ├── db.c
│ ├── db.h
│ ├── dir.c
│ ├── duc.c
│ ├── duc.h
│ ├── index.c
│ ├── list.c
│ ├── list.h
│ ├── private.h
│ ├── uthash.h
│ ├── utlist.h
│ ├── utstring.h
│ ├── varint.c
│ └── varint.h
├── test.sh
├── testing
└── dbs
│ ├── kyotocabinet.db
│ ├── lmdb.db
│ ├── sqlite3.db
│ └── tokyocabinet.db
├── todo
└── valgrind-suppressions
/.gitignore:
--------------------------------------------------------------------------------
1 | *.o
2 | *.a
3 | *.la
4 | *.lo
5 | *.swp
6 | *.rej
7 | *.orig
8 | /aclocal.m4
9 | /autom4te.cache/
10 | /config.*
11 | /compile
12 | /config.status
13 | /Makefile.in
14 | /Makefile
15 | /configure
16 | /libtool
17 | /ltmain.sh
18 | /missing
19 | /stamp-h1
20 | /install-sh
21 | /depcomp
22 | /test
23 | /go
24 | .deps/
25 | .dirstamp
26 | /duc
27 |
--------------------------------------------------------------------------------
/.travis.yml:
--------------------------------------------------------------------------------
1 | language: c
2 | os:
3 | - linux
4 | compiler:
5 | - gcc
6 | - clang
7 | before_install:
8 | - sudo apt-get update -qq
9 | - sudo apt-get install -qq libcairo2-dev libpango1.0-dev libtokyocabinet-dev imagemagick jp2a libgles2-mesa-dev
10 | script:
11 | - autoreconf -i
12 | - ./configure
13 | - make
14 | - sudo make install
15 | - sudo ldconfig
16 | - sudo duc index -x /
17 | - sudo duc ls /usr
18 | - sudo duc graph /
19 | - identify duc.png
20 | - convert duc.png duc.jpg
21 | - jp2a duc.jpg
22 | - ls -l /dev/stdin /dev/stdout /dev/stderr
23 | - ls -l /proc/self/fd/0 /proc/self/fd/1 /proc/self/fd/2
24 |
25 |
--------------------------------------------------------------------------------
/ChangeLog:
--------------------------------------------------------------------------------
1 | 1.5.0-rc1 (2024-09-03)
2 | - new: added support for tkrzw backend DB and made it the default
3 | - this DB is newer and under active support compared to
4 | TokyoCabinet, KyotoCabinet, etc.
5 | - also supports really large filesystems. Big thanks to
6 | stuartthebruce for testing and debugging (Issue #300)
7 | - new: added support to tracking topN largest files in
8 | filesystem. (Issue #284)
9 | - new: added '-T' option to duc index to change maximum default number of
10 | topN files to track.
11 | - new: added '-B' option to duc index to change number of histogram buckets.
12 | - new: added 'topn' command to show topN files stored in
13 | DB. defaults to 10 currently.
14 | - new: added 't' key in duc ui to toggle between regular and topN
15 | display mode. Initial support.
16 | - new: added histogram report of filesizes found during
17 | indexing to 'duc info'. (Issue #284)
18 | - new: added 'H' or '--histogram' option to duc info
19 | - new: added 'duc histogram' command (Issue #284)
20 | - needs work still, especially CGI, UI and GUI output.
21 | - fix:
22 |
23 | 1.4.5 (2022-07-29)
24 |
25 | - new: added '-u' option to duc index to index by username
26 | - new: added `json` subcommand (thanks Nicolas!)
27 | - new: added support for NO_COLOR env var
28 | - cha: duc db location is now XDG compliant
29 | - fix: various bug fixes, check the git log for details
30 |
31 | 1.4.4 (2018-09-28)
32 |
33 | - new: added --directory/-D option to 'duc ls' to allow listing
34 | of only directory itself (#196)
35 | - new: 'duc ls' now handles multiple path arguments
36 | - new: added 'o' key to duc-ui to pass current file to xdg-open
37 | - new: added DPI handing for graph font size (#201)
38 | - new: added '-a/--apparent' option to 'duc xml' (#171)
39 | - fix: improved cairo and SVG graph rendering (#202)
40 | - cha: changed license from GPL to LGPL (#190)
41 |
42 | 1.4.3 (2017-01-02)
43 |
44 | - fix: fixed mouse and tooltip coordinates in scrolled CGI
45 | - fix: fixed lmdb read/write locking
46 | - new: added --dry-run option to 'duc index' for testing purposes
47 |
48 | 1.4.2 (2016-11-20)
49 |
50 | - new: default per-user file path is now ~/.config/duc/ducrc
51 | - new: added 'classic' palette for Philesight look
52 | - new: added -n/--name-sort option to 'duc ui' and 'duc ls'
53 | - new: added --header and --footer options to 'duc cgi'
54 | - cha: warnings in during indexing now show full path
55 | - fix: fixed multiline label printing in CGI graph
56 | - fix: removed PATH_MAX references which broke build on GNU Hurd
57 | - fix: fixed line stroking for HTML drawing backend
58 |
59 | 1.4.1 (2016-03-12)
60 |
61 | - new: added --fs-include and --fs-exclude options
62 | - cha: disabled gui gradients by default. use the --gradient option
63 | for original graph style
64 | - cha: tooltip now shows actual size, apparent size and count
65 | - fix: once more fixed cgi parameter decoding
66 | - fix: fixed handling of filenames with spaces in 'duc cgi'
67 |
68 | 1.4.0 (2016-02-24)
69 |
70 | - new: added --count option
71 | - new: added support for windows
72 | - cha: renamed guigl to gui, only one gui (X11/OpenGL) can now be enabled
73 | - cha: improved font handling on OpenGL backend
74 | - cha: changed CGI environment detection to work around bug in Lighttpd
75 |
76 | 1.3.2 (2015-06-14)
77 |
78 | - fix: added missing file font.c for --enable-opengl
79 |
80 | 1.3.2 (2015-06-13)
81 |
82 | - fix: rewind dir before drawing 'list' in CGI
83 | - fix: fix clicking through CGI graph if tooltip is not enabled
84 |
85 | 1.3 (2015-06-12)
86 |
87 | - new: added SVG and HTML/canvas graph back ends
88 | - new: added OpenGL/GLFW graph back end for better portability
89 | - new: added tooltip to CGI, enable with --tooltip option
90 | - new: duc database is now portable between endianness and
91 | architectures for sqlite3 databases
92 | - new: added --ring-gap option to gui
93 | - new: added --color option to ui
94 | - cha: optimized memory usage
95 | - fix: fixed building on Solaris
96 | - fix: added better error handling in sqlite3 backend
97 |
98 | 1.2 (2015-05-11)
99 |
100 | - new: Added --dark option to duc-gui
101 | - fix: Fixed CGI file system traversing
102 | - fix: Fixed duc-info output to be consistent with other tools
103 |
104 | 1.1 (2015-05-09)
105 |
106 | - new: Added support for leveldb database backend
107 | - new: Some visual changes and performance improvements in duc-gui
108 | - new: Link to ncursesw if available for proper UTF-8 support in
109 | duc-ui
110 | - fix: Fixed HTML and CGI escaping for duc-cgi
111 | - fix: Fixed unit scaling on 'humanized' formatted numbers
112 | - fix: Added UTF-8 charset declaration to duc-cgi
113 | - fix: Fatal errors are still printed in --quiet mode
114 | - fix: Better handling of non-printable characters in file names
115 |
116 | 1.0-rc1 (2015-04-25)
117 |
118 | - First release candidate for 1.0
119 |
120 |
121 |
--------------------------------------------------------------------------------
/INSTALL:
--------------------------------------------------------------------------------
1 |
2 | Quickstart
3 | ----------
4 |
5 | To build Duc with its default options, run:
6 |
7 | $ ./configure
8 | $ make
9 | $ sudo make install
10 |
11 | Generate the configure script when it is not available (cloned git repo):
12 |
13 | $ autoreconf -i
14 |
15 |
16 | To get the required dependencies on Debian or Ubuntu, run:
17 |
18 | $ sudo apt-get install libncursesw5-dev libcairo2-dev libpango1.0-dev \
19 | build-essential libtkrzw-dev
20 |
21 | On Debian 11 (bullseye), you need to have the following line in your
22 | /etc/apt/sources.list file:
23 |
24 | deb http://deb.debian.org/debian bullseye-backports main
25 |
26 | Then you would do:
27 |
28 | $ sudo apt update
29 |
30 | $ sudo apt-get install libncursesw5-dev libcairo2-dev libpango1.0-dev \
31 | build-essential libtkrzw-dev tkrzw-doc tkrzw-utils
32 |
33 |
34 | On older RHEL or CentOS systems, you need to do:
35 |
36 | $ sudo yum install pango-devel cairo-devel tokyocabinet-devel
37 |
38 |
39 | RHEL 8 & 9 / Rockly Linux 8 & 9 / Alma Linux 8 & 9
40 |
41 | Install epel-release & update
42 |
43 | $ sudo yum install epel-release
44 | $ sudo yum update
45 |
46 | Install tkrzw and other packages:
47 |
48 | $ sudo yum install tkrzw tkrzw-devel tkrzw-doc tkrzw-libs pango-devel cairo-devel tokyocabinet-devel
49 |
50 |
51 | Configuration Options
52 | ---------------------
53 |
54 | Duc comes with support for various user interfaces and a number of
55 | backends for database access and graph drawing. You can choose which
56 | options should be used with the ./configure script to build Duc to fit
57 | best in your environment.
58 |
59 | This document describes the various options which can be passed to the
60 | ./configure script, and the impact these options have on Duc
61 | functionality. But the ./configure --help is the definitive source.
62 |
63 |
64 | User interfaces
65 | ---------------
66 |
67 | Duc comes with the following user interfaces:
68 |
69 | - Command line interface (duc ls): This user interface has no external
70 | dependencies and is always enabled.
71 |
72 | - Ncurses console interface (duc ui): an interactive console interface, which
73 | depends on ncurses or ncursesw. This user interface is enabled by default. If
74 | your system does not provide ncurses, you can disable this with
75 |
76 | --disable-ui
77 |
78 | - X11 GUI (duc gui): This is the default interface for Linux and other Unix
79 | systems. This user interface depends on the cairo library (see below). If
80 | your system has no X11 or cairo available, disable this user interface with:
81 |
82 | --disable-x11
83 |
84 | - OpenGL GUI (duc gui): an OpenGL/GLFW user interface which should be portable
85 | on a large range of operating systems. The OpenGL gui is disabled by default.
86 | If you want to enable OpenGL, run ./configure with:
87 |
88 | --enable-opengl --disable-x11
89 |
90 |
91 | Database backends
92 | -----------------
93 |
94 | Duc supports various key-value database backends:
95 | - Tokyo Cabinet: tokyocabinet
96 | - LevelDB: leveldb
97 | - Sqlite3: sqlite3
98 | - Lightning Memory-Mapped Database: lmdb
99 | - Kyoto Cabinet: kyotocabinet
100 | - Tkrzw: tkrzw (default as of v1.5.0)
101 |
102 | Duc now uses Tkrzw by default: the performance is acceptable and it
103 | handles extremely large databases of volumes with terabytes of storage
104 | and millions of files.
105 |
106 | --with-db-backend=ARG
107 |
108 | If your system supports none of the above, contact the authors to see
109 | if we can add your favourite backend.
110 |
111 | Please note: Not all database formats can be shared between machines
112 | with different architectures. Notably, Tokyo Cabinet is built with
113 | non-standard options which break compatibility with other linux
114 | distributions, even on the same architecture [1]. If you are planning
115 | to share databases between different platforms (index machine A,
116 | display on machine B) we recommend using the sqlite3 backend.
117 |
118 | Note, Tokyo Cabiner, Kyoto Cabinet, LevelDB and LMDB are all being
119 | deprecated from future versions because the lack of development and
120 | support for these libraries, especially for super large volumes to be
121 | indexed.
122 |
123 | 1. https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=667979
124 |
125 | When picking a backend you probably need to choose between speed, size
126 | and robustness. Some (out of date) measurements on a system with a
127 | 372G directory containing 1.6M files:
128 |
129 | ----------------------------------
130 | Database Run time Db size
131 | (s) (kB)
132 | ----------------------------------
133 | tokyocabinet 8.4 19.2
134 | leveldb 7.1 31.5
135 | sqlite3 13.5 71.1
136 | lmdb 5.9 78.7
137 | kyotocabinet 8.3 26.7
138 | tkrzw [*] ??? ???
139 | ----------------------------------
140 |
141 |
142 | [*] Tkrzw currently is the default used by Duc because of it's current
143 | development, good compression and reasonable performance.
144 |
145 | Tokyo Cabinet is not very stable and can create corrupt databases when
146 | interrupting the indexing. If this is a problem for you, choose a
147 | different db backend.
148 |
149 |
150 | Graphics
151 | --------
152 |
153 | Duc supports various backends for creating graphics, but some have dependencies
154 | which cannot be met on all systems. Especially on headless server systems or
155 | embedded systems not all graphics libraries are available.
156 |
157 | - SVG: Duc has native SVG support, which can be used by the 'duc graph' command
158 | to create static images of disk usage. The SVG backend has no external
159 | dependencies and is always enabled.
160 |
161 | - HTML canvas: Duc has native support for generating graphs in HTML5 using
162 | JavaScript and the canvas object. The HTML backend has not external
163 | dependencies and is always enabled.
164 |
165 | - Cairo/pango: The cairo/pango backend is required for the X11 user interface,
166 | and also adds an option to the duc-graph command to generate images in .PNG
167 | or .PDF file format. If your systems does not have cairo and pango available,
168 | add the following flag to ./configure:
169 |
170 | --disable-cairo
171 |
172 | - OpenGL: Duc can draw to OpenGL contexts and can be used by the 'duc gui'
173 | command. To enable the OpenGL backend for the 'duc gui' command, run
174 | ./configure with:
175 |
176 | --enable-opengl --disable-x11
177 |
178 |
179 | Testing
180 | -------
181 |
182 | Duc comes with a rudimentary test harness which can be run at the top
183 | level directory with:
184 |
185 | ./test.sh
186 |
187 | If you have valgrind and you want to run the tests using it do:
188 |
189 | USE_VALGRIND=1 ./test.sh
190 |
191 | It will complain if you try this and valgrind isn't installed. The
192 | test harness still needs work and more tests, but should hopefully
193 | help keep us from re-introducing bugs as they are fixed and checked
194 | for. We would love to see more tests and a better harness, patches
195 | welcome!
196 |
197 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | GNU LESSER GENERAL PUBLIC LICENSE
2 | Version 3, 29 June 2007
3 |
4 | Copyright (C) 2007 Free Software Foundation, Inc.
5 | Everyone is permitted to copy and distribute verbatim copies
6 | of this license document, but changing it is not allowed.
7 |
8 |
9 | This version of the GNU Lesser General Public License incorporates
10 | the terms and conditions of version 3 of the GNU General Public
11 | License, supplemented by the additional permissions listed below.
12 |
13 | 0. Additional Definitions.
14 |
15 | As used herein, "this License" refers to version 3 of the GNU Lesser
16 | General Public License, and the "GNU GPL" refers to version 3 of the GNU
17 | General Public License.
18 |
19 | "The Library" refers to a covered work governed by this License,
20 | other than an Application or a Combined Work as defined below.
21 |
22 | An "Application" is any work that makes use of an interface provided
23 | by the Library, but which is not otherwise based on the Library.
24 | Defining a subclass of a class defined by the Library is deemed a mode
25 | of using an interface provided by the Library.
26 |
27 | A "Combined Work" is a work produced by combining or linking an
28 | Application with the Library. The particular version of the Library
29 | with which the Combined Work was made is also called the "Linked
30 | Version".
31 |
32 | The "Minimal Corresponding Source" for a Combined Work means the
33 | Corresponding Source for the Combined Work, excluding any source code
34 | for portions of the Combined Work that, considered in isolation, are
35 | based on the Application, and not on the Linked Version.
36 |
37 | The "Corresponding Application Code" for a Combined Work means the
38 | object code and/or source code for the Application, including any data
39 | and utility programs needed for reproducing the Combined Work from the
40 | Application, but excluding the System Libraries of the Combined Work.
41 |
42 | 1. Exception to Section 3 of the GNU GPL.
43 |
44 | You may convey a covered work under sections 3 and 4 of this License
45 | without being bound by section 3 of the GNU GPL.
46 |
47 | 2. Conveying Modified Versions.
48 |
49 | If you modify a copy of the Library, and, in your modifications, a
50 | facility refers to a function or data to be supplied by an Application
51 | that uses the facility (other than as an argument passed when the
52 | facility is invoked), then you may convey a copy of the modified
53 | version:
54 |
55 | a) under this License, provided that you make a good faith effort to
56 | ensure that, in the event an Application does not supply the
57 | function or data, the facility still operates, and performs
58 | whatever part of its purpose remains meaningful, or
59 |
60 | b) under the GNU GPL, with none of the additional permissions of
61 | this License applicable to that copy.
62 |
63 | 3. Object Code Incorporating Material from Library Header Files.
64 |
65 | The object code form of an Application may incorporate material from
66 | a header file that is part of the Library. You may convey such object
67 | code under terms of your choice, provided that, if the incorporated
68 | material is not limited to numerical parameters, data structure
69 | layouts and accessors, or small macros, inline functions and templates
70 | (ten or fewer lines in length), you do both of the following:
71 |
72 | a) Give prominent notice with each copy of the object code that the
73 | Library is used in it and that the Library and its use are
74 | covered by this License.
75 |
76 | b) Accompany the object code with a copy of the GNU GPL and this license
77 | document.
78 |
79 | 4. Combined Works.
80 |
81 | You may convey a Combined Work under terms of your choice that,
82 | taken together, effectively do not restrict modification of the
83 | portions of the Library contained in the Combined Work and reverse
84 | engineering for debugging such modifications, if you also do each of
85 | the following:
86 |
87 | a) Give prominent notice with each copy of the Combined Work that
88 | the Library is used in it and that the Library and its use are
89 | covered by this License.
90 |
91 | b) Accompany the Combined Work with a copy of the GNU GPL and this license
92 | document.
93 |
94 | c) For a Combined Work that displays copyright notices during
95 | execution, include the copyright notice for the Library among
96 | these notices, as well as a reference directing the user to the
97 | copies of the GNU GPL and this license document.
98 |
99 | d) Do one of the following:
100 |
101 | 0) Convey the Minimal Corresponding Source under the terms of this
102 | License, and the Corresponding Application Code in a form
103 | suitable for, and under terms that permit, the user to
104 | recombine or relink the Application with a modified version of
105 | the Linked Version to produce a modified Combined Work, in the
106 | manner specified by section 6 of the GNU GPL for conveying
107 | Corresponding Source.
108 |
109 | 1) Use a suitable shared library mechanism for linking with the
110 | Library. A suitable mechanism is one that (a) uses at run time
111 | a copy of the Library already present on the user's computer
112 | system, and (b) will operate properly with a modified version
113 | of the Library that is interface-compatible with the Linked
114 | Version.
115 |
116 | e) Provide Installation Information, but only if you would otherwise
117 | be required to provide such information under section 6 of the
118 | GNU GPL, and only to the extent that such information is
119 | necessary to install and execute a modified version of the
120 | Combined Work produced by recombining or relinking the
121 | Application with a modified version of the Linked Version. (If
122 | you use option 4d0, the Installation Information must accompany
123 | the Minimal Corresponding Source and Corresponding Application
124 | Code. If you use option 4d1, you must provide the Installation
125 | Information in the manner specified by section 6 of the GNU GPL
126 | for conveying Corresponding Source.)
127 |
128 | 5. Combined Libraries.
129 |
130 | You may place library facilities that are a work based on the
131 | Library side by side in a single library together with other library
132 | facilities that are not Applications and are not covered by this
133 | License, and convey such a combined library under terms of your
134 | choice, if you do both of the following:
135 |
136 | a) Accompany the combined library with a copy of the same work based
137 | on the Library, uncombined with any other library facilities,
138 | conveyed under the terms of this License.
139 |
140 | b) Give prominent notice with the combined library that part of it
141 | is a work based on the Library, and explaining where to find the
142 | accompanying uncombined form of the same work.
143 |
144 | 6. Revised Versions of the GNU Lesser General Public License.
145 |
146 | The Free Software Foundation may publish revised and/or new versions
147 | of the GNU Lesser General Public License from time to time. Such new
148 | versions will be similar in spirit to the present version, but may
149 | differ in detail to address new problems or concerns.
150 |
151 | Each version is given a distinguishing version number. If the
152 | Library as you received it specifies that a certain numbered version
153 | of the GNU Lesser General Public License "or any later version"
154 | applies to it, you have the option of following the terms and
155 | conditions either of that published version or of any later version
156 | published by the Free Software Foundation. If the Library as you
157 | received it does not specify a version number of the GNU Lesser
158 | General Public License, you may choose any version of the GNU Lesser
159 | General Public License ever published by the Free Software Foundation.
160 |
161 | If the Library as you received it specifies that a proxy can decide
162 | whether future versions of the GNU Lesser General Public License shall
163 | apply, that proxy's public statement of acceptance of any version is
164 | permanent authorization for you to choose that version for the
165 | Library.
166 |
--------------------------------------------------------------------------------
/Makefile.am:
--------------------------------------------------------------------------------
1 |
2 | bin_PROGRAMS := duc
3 |
4 | duc_SOURCES := \
5 | src/libduc/buffer.c \
6 | src/libduc/buffer.h \
7 | src/libduc/db.c \
8 | src/libduc/db.h \
9 | src/libduc/db-tokyo.c \
10 | src/libduc/db-tkrzw.c \
11 | src/libduc/db-kyoto.c \
12 | src/libduc/db-leveldb.c \
13 | src/libduc/db-sqlite3.c \
14 | src/libduc/db-lmdb.c \
15 | src/libduc/dir.c \
16 | src/libduc/duc.c \
17 | src/libduc/duc.h \
18 | src/libduc/index.c \
19 | src/libduc/private.h \
20 | src/libduc/canonicalize.c \
21 | src/libduc/varint.c \
22 | src/libduc/varint.h \
23 | src/libduc/uthash.h \
24 | src/libduc/utlist.h \
25 | src/libduc/utstring.h
26 |
27 | duc_SOURCES += \
28 | src/glad/glad.c \
29 | src/glad/KHR/khrplatform.h \
30 | src/glad/glad/glad.h
31 |
32 | duc_SOURCES += \
33 | src/libduc-graph/graph.c \
34 | src/libduc-graph/graph-cairo.c \
35 | src/libduc-graph/graph-opengl.c \
36 | src/libduc-graph/graph-svg.c \
37 | src/libduc-graph/graph-html.c \
38 | src/libduc-graph/graph-private.h \
39 | src/libduc-graph/duc-graph.h
40 |
41 | duc_SOURCES += \
42 | src/duc/cmd-cgi.c \
43 | src/duc/cmd-graph.c \
44 | src/duc/cmd-gui.c \
45 | src/duc/cmd-guigl.c \
46 | src/duc/cmd.h \
47 | src/duc/cmd.h \
48 | src/duc/cmd-histogram.c \
49 | src/duc/cmd-index.c \
50 | src/duc/cmd-info.c \
51 | src/duc/cmd-ls.c \
52 | src/duc/cmd-topn.c \
53 | src/duc/cmd-ui.c \
54 | src/duc/cmd-xml.c \
55 | src/duc/cmd-json.c \
56 | src/duc/ducrc.c \
57 | src/duc/ducrc.h \
58 | src/duc/main.c
59 |
60 |
61 | AM_CFLAGS := @CAIRO_CFLAGS@ @PANGO_CFLAGS@ @PANGOCAIRO_CFLAGS@
62 | AM_CFLAGS += @TC_CFLAGS@ @SQLITE3_CFLAGS@ @GLFW3_CFLAGS@ @LMDB_CFLAGS@
63 | AM_CFLAGS += @KC_CFLAGS@ @TKRZW_CFLAGS@
64 | AM_CFLAGS += -Isrc/libduc -Isrc/libduc-graph -Isrc/glad
65 |
66 | duc_LDADD := @CAIRO_LIBS@ @PANGO_LIBS@ @PANGOCAIRO_LIBS@
67 | duc_LDADD += @TC_LIBS@ @SQLITE3_LIBS@ @GLFW3_LIBS@ @LMDB_LIBS@ @KC_LIBS@ @TKRZW_LIBS@
68 |
69 | man1_MANS = \
70 | doc/duc.1
71 |
72 | EXTRA_DIST = \
73 | doc/duc.1 \
74 | doc/duc.1.html \
75 | src/libduc-graph/font.c \
76 | doc/duc.md \
77 | LICENSE
78 |
79 | install-exec-hook:
80 | -/sbin/ldconfig || :;
81 |
82 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
2 | [](https://travis-ci.org/zevv/duc) [](https://anaconda.org/conda-forge/duc)
3 |
4 | Duc is a collection of tools for indexing, inspecting and visualizing disk
5 | usage. Duc maintains a database of accumulated sizes of directories of the file
6 | system, and allows you to query this database with some tools, or create fancy
7 | graphs showing you where your bytes are.
8 |
9 | Check the [Duc homepage](http://duc.zevv.nl) for more information, documentation and news.
10 |
11 | 
12 |
13 |
14 |
--------------------------------------------------------------------------------
/TODO.md:
--------------------------------------------------------------------------------
1 |
2 | This is a list of feature requests and enhancements that have come up over the
3 | years. Most of them are not easy to implement in the current architecture, but
4 | I'm still keeping the requests here for future reference or for if I ever get
5 | bored and have a lot of time on my hands. Anybody is free to pick and implement
6 | any of these tasks, of course!
7 |
8 | ### Edit database to remove path(s) from Index and do all cleanup
9 |
10 | This should be a simple change to add, though it does require some hackery to
11 | remove entries from the records[] array in the DB. Needs thought. Currently
12 | only solution would be to index to a totally new DB file with only the path(s)
13 | you want.
14 |
15 | ### Show increase since last index or time period
16 |
17 | https://github.com/zevv/duc/issues/153
18 |
19 | The main reason I started using this tool is actually trying to find users
20 | that increase their home directory rapidly. It was easy in the beginning but
21 | starting to get much harder now that we have more users and I keep forgetting
22 | the initial size. :) I think it would be nice, and certainly possible?, for
23 | DUC to show the increase in % since last index or a configured time period
24 | (say 7 days ago).
25 |
26 | ### Incremental Indexing
27 |
28 | https://github.com/zevv/duc/issues/115
29 |
30 | Just a question, is the indexing process incremental or does it restart the
31 | indexing from scratch each time?
32 |
33 | ### Per user filtering
34 |
35 | https://github.com/zevv/duc/issues/30
36 |
37 | At work I have to monitor files that differ on a per-user basis, so it would
38 | be nice to produce graphs that are limited to a single user and / or use the
39 | data to produce a graph that showed the percentage of the disk space used by
40 | a specific user. This way I could send users graphs of the disk usage limited
41 | to their user.
42 |
43 | ### Directory mtime optimization
44 |
45 | https://github.com/zevv/duc/issues/101
46 |
47 | When running index against an existing database does duc compare the current
48 | mtime of directories in the filesystem versus the database to see whether
49 | readdir() is needed to update the database, or as a performance optimization
50 | whether an update of that directory can be skipped?
51 |
52 | ### overall graph of multiple datasets in a database
53 |
54 | https://github.com/zevv/duc/issues/56
55 |
56 |
57 |
--------------------------------------------------------------------------------
/build/README.md:
--------------------------------------------------------------------------------
1 | Installation through RPM
2 | ========================
3 |
4 | If you want you can install duc through a rpm package. Under `build/duc.spec` you find the spec file to build the rpm.
5 |
6 | Tested on `CentOS 6.5`.
7 |
8 | ### Build
9 |
10 | Using `mock` and `rpmdevtools` to create the rpm (`yum install mock rpm-build rpmdevtools` from `EPEL` ).
11 |
12 | ##### User
13 |
14 | Add new mock user:
15 |
16 | ```sh
17 | useradd
18 | passwd
19 | usermod -aG mock
20 | ```
21 |
22 | Or editing existing users:
23 |
24 | ```sh
25 | usermod -aG mock && newgrp mock
26 | ```
27 |
28 | ##### Get sources from repository
29 |
30 | ```sh
31 | cd deploy/rpmbuild/
32 | spectool -g duc.spec
33 | ```
34 |
35 | ##### Build the sources (src.rpm)
36 |
37 | ```sh
38 | mock --resultdir=. --root epel-6-x86_64 --buildsrpm --spec duc.spec --sources .
39 | ```
40 |
41 | ##### Build rpm
42 |
43 | ```sh
44 | mock --resultdir=. --root=epel-6-x86_64 --rebuild duc-1.0-1.el6.src.rpm
45 | ```
46 |
47 | After this operations you have `duc-1.0-1.el6.x86_64.rpm`. To install it simply run:
48 |
49 | ```sh
50 | yum localinstall duc-1.0-1.el6.x86_64.rpm
51 | ```
52 |
--------------------------------------------------------------------------------
/build/duc.spec:
--------------------------------------------------------------------------------
1 | %global name duc
2 | %global version 1.4.4
3 | %global release 1
4 |
5 | Name: %{name}
6 | Version: %{version}
7 | Release: %{release}%{?dist}
8 | Summary: Duc, a library and suite of tools for inspecting disk usage
9 | Requires: pango cairo tokyocabinet ncurses
10 |
11 | License: GNU General Public License
12 | URL: https://github.com/zevv/duc
13 | Source0: https://github.com/zevv/duc/releases/download/%{version}/duc-%{version}.tar.gz
14 |
15 | BuildArch: x86_64
16 | BuildRequires: libtool autoconf
17 | BuildRequires: pango-devel cairo-devel tokyocabinet-devel ncurses-devel
18 |
19 | %description
20 | Duc is a small library and a collection of tools for inspecting and visualizing
21 | disk usage.
22 | Duc maintains a database of accumulated sizes of directories of your file system,
23 | and allows you to query this database with some tools,
24 | or create fancy graphs showing you where your bytes are.
25 |
26 | %prep
27 | %setup
28 |
29 | %build
30 | autoreconf --install
31 | ./configure --libdir=%{_libdir} --bindir=%{_bindir} --mandir=%{_mandir}
32 | make
33 |
34 | %install
35 | make install DESTDIR=$RPM_BUILD_ROOT
36 |
37 | %post
38 |
39 | %clean
40 | rm -rf $RPM_BUILD_ROOT
41 |
42 | %files
43 | %defattr(-,root,root)
44 | %{_bindir}/%{name}
45 | %{_mandir}/man1/%{name}.1.gz
46 |
47 | %changelog
48 | * Mon Oct 14 2019 Peter Cummuskey - 1.4.4
49 | - Update to 1.4.4
50 | - Added runtime requirements
51 |
52 | * Mon Jan 02 2017 Giacomo Sanchietti - 1.4.3
53 | - Update to 1.4.3
54 |
55 | * Fri Dec 09 2016 Giacomo Sanchietti - 1.4.2
56 | - Update to 1.4.2
57 | - Removed devel rpm
58 | - Cleanup spec
59 |
60 | * Mon Jun 29 2015 James Chang - 1.3.3
61 | - added ncurses-devel package requirement
62 | - fixed file not found for libs
63 |
64 | * Wed Feb 11 2015 Edoardo Spadoni - 1.0
65 | - first version
66 |
--------------------------------------------------------------------------------
/configure.ac:
--------------------------------------------------------------------------------
1 | # -*- Autoconf -*-
2 | # Process this file with autoconf, et al to produce a configure script.
3 | #
4 | # autoreconf -v -f
5 | # which is just:
6 | # aclocal && autoconf && automake -a -f && ./configure && make
7 |
8 | AC_PREREQ([2.13])
9 |
10 | AC_INIT([duc], [1.5.0-rc1], [duc@zevv.nl])
11 |
12 | LIB_CURRENT=1
13 | LIB_REVISION=0
14 | LIB_AGE=0
15 | AC_SUBST(LIB_CURRENT)
16 | AC_SUBST(LIB_REVISION)
17 | AC_SUBST(LIB_AGE)
18 |
19 | AM_INIT_AUTOMAKE([foreign subdir-objects])
20 |
21 | AC_CONFIG_HEADER([config.h])
22 | AC_GNU_SOURCE
23 |
24 | AC_SYS_LARGEFILE
25 | AC_SYS_LONG_FILE_NAMES
26 |
27 | AC_PROG_CC
28 | PKG_PROG_PKG_CONFIG
29 |
30 | AC_CHECK_LIB([m], [main])
31 | AC_CHECK_MEMBERS([struct stat.st_blocks])
32 |
33 | #
34 | # Check --disable options
35 | #
36 |
37 | AC_ARG_ENABLE(
38 | [cairo],
39 | [AS_HELP_STRING([--disable-cairo], [disable cairo drawing @<:@default=yes@:>@])], ,
40 | [enable_cairo="yes"]
41 | )
42 |
43 | AC_ARG_ENABLE(
44 | [opengl],
45 | [AS_HELP_STRING([--enable-opengl], [enable OpenGL drawing @<:@default=no@:>@])], ,
46 | [enable_opengl="no"]
47 | )
48 |
49 | AC_ARG_ENABLE(
50 | [ui],
51 | [AS_HELP_STRING([--disable-ui], [disable ncurses ui @<:@default=yes@:>@])], ,
52 | [enable_ui="yes"]
53 | )
54 |
55 | AC_ARG_ENABLE(
56 | [x11],
57 | [AS_HELP_STRING([--disable-x11], [disable X11 @<:@default=yes@:>@])], ,
58 | [enable_x11="yes"]
59 | )
60 |
61 | AC_ARG_WITH(
62 | [db-backend],
63 | [AS_HELP_STRING([--with-db-backend], [select database backend (tokyocabinet,leveldb,sqlite3,lmdb,kyotocabinet,tkrzw) @<:@default=tkrzw@:>@])], ,
64 | [with_db_backend="tkrzw"]
65 | )
66 |
67 | AC_MSG_RESULT([Selected backend ${with_db_backend}])
68 |
69 | #
70 | # Check for available libraries
71 | #
72 |
73 | case "${with_db_backend}" in
74 | tokyocabinet)
75 | PKG_CHECK_MODULES([TC], [tokyocabinet])
76 | AC_DEFINE([ENABLE_TOKYOCABINET], [1], [Enable tokyocabinet db backend])
77 | ;;
78 | tkrzw)
79 | LDFLAGS="$outer_LDFLAGS -ltkrzw"
80 | AC_CHECK_LIB(tkrzw, tkrzw_get_last_status,
81 | [
82 | TKRZW_LIBS="-ltkrzw"
83 | AC_DEFINE([ENABLE_TKRZW], [1], [Enable tkrzw db backend])
84 | ], [ AC_MSG_ERROR(Unable to find tkrzw) ])
85 | AC_SUBST([TKRZW_LIBS])
86 | p AC_SUBST([TKRZW_CFLAGS])
87 | ;;
88 | leveldb)
89 | AC_CHECK_LIB([leveldb], [leveldb_open])
90 | AC_DEFINE([ENABLE_LEVELDB], [1], [Enable leveldb db backend])
91 | ;;
92 | sqlite3)
93 | PKG_CHECK_MODULES([SQLITE3], [sqlite3])
94 | AC_DEFINE([ENABLE_SQLITE], [1], [Enable sqlite3 db backend])
95 | ;;
96 | lmdb)
97 | LDFLAGS="$outer_LDFLAGS -llmdb"
98 | AC_CHECK_LIB(lmdb, mdb_env_create,
99 | [
100 | LMDB_LIBS="-llmdb"
101 | AC_DEFINE([ENABLE_LMDB], [1], [Enable lmdb db backend])
102 | ], [ AC_MSG_ERROR(Unable to find LMDB) ])
103 | AC_SUBST([LMDB_LIBS])
104 | AC_SUBST([LMDB_CFLAGS])
105 | ;;
106 | kyotocabinet)
107 | PKG_CHECK_MODULES([KC], [kyotocabinet])
108 | AC_DEFINE([ENABLE_KYOTOCABINET], [1], [Enable kyotocabinet db backend])
109 | ;;
110 | *)
111 | AC_MSG_ERROR([Unsupported db-backend "${with_db_backend}"])
112 | esac
113 |
114 | AC_DEFINE_UNQUOTED(DB_BACKEND, ["${with_db_backend}"], [Database backend])
115 |
116 | if test "${enable_cairo}" = "yes"; then
117 |
118 | PKG_CHECK_MODULES([CAIRO], [cairo],, [AC_MSG_ERROR([
119 | The cairo library was not found, which is needed for graph support. Either install
120 | the cairo development libraries, or compile without graph support (--disable-cairo)
121 | ])])
122 |
123 | PKG_CHECK_MODULES([PANGO], [pango],, [AC_MSG_ERROR([
124 | The pango library was not found, which is needed for graph support. Either install
125 | the pango development libraries, or compile without graph support (--disable-cairo)
126 | ])])
127 |
128 | PKG_CHECK_MODULES([PANGOCAIRO], [pangocairo],, [AC_MSG_ERROR([
129 | The pangocairo library was not found, which is needed for graph support. Either install
130 | the pangocairo development libraries, or compile without graph support (--disable-cairo)
131 | ])])
132 |
133 | AC_DEFINE([ENABLE_CAIRO], [1], [Enable cairo])
134 | fi
135 |
136 | if test "${enable_opengl}" = "yes"; then
137 |
138 | PKG_CHECK_MODULES([GLFW3], [glfw3],, [AC_MSG_ERROR([
139 | The glfw3 library was not found, which is needed for opengl support. Either install
140 | the glfw3 development libraries, or compile without opengl support (--disable-opengl)
141 | ])])
142 |
143 | if test "${enable_x11}" = "yes"; then
144 | AC_MSG_ERROR([
145 | Only one graphical user interface can be configured, use --disable-x11 when
146 | using --enable-opengl])
147 | fi
148 |
149 | AC_CHECK_LIB([dl], [dlopen])
150 | AC_DEFINE([ENABLE_OPENGL], [1], [Enable opengl])
151 | fi
152 |
153 |
154 | if test "${enable_ui}" = "yes"; then
155 | AC_DEFINE([ENABLE_UI], [1], [Enable ui])
156 |
157 | AC_CHECK_LIB([ncursesw], [tputs],, [
158 | AC_CHECK_LIB([ncurses], [tputs],, [
159 | AC_MSG_ERROR([
160 | The ncurses library was not found, which is needed for ui support. Either install
161 | the ncurses development libraries, or compile without ui support (--disable-ui)
162 | ])
163 | ])
164 | ])
165 | fi
166 |
167 |
168 | if test "${enable_x11}" = "yes"; then
169 | test "${enable_cairo}" != "yes" && AC_MSG_ERROR([cairo must be enabled for x11])
170 |
171 | AC_CHECK_LIB([X11], [XOpenDisplay],, [AC_MSG_ERROR([
172 | The X11 library was not found, which is needed for x11 gui support.
173 | ])])
174 | AC_DEFINE([ENABLE_X11], [1], [Enable X11])
175 | fi
176 |
177 |
178 | AC_CHECK_HEADERS([fcntl.h limits.h stdint.h stdlib.h string.h sys/ioctl.h unistd.h fnmatch.h termios.h])
179 | AC_CHECK_HEADERS([ncurses.h ncurses/ncurses.h ncursesw/ncurses.h])
180 |
181 | AC_TYPE_MODE_T
182 | AC_TYPE_OFF_T
183 | AC_TYPE_SIZE_T
184 | AC_TYPE_UINT32_T
185 | AC_TYPE_UINT64_T
186 | AC_TYPE_UINT8_T
187 | AC_CHECK_TYPES([dev_t, ino_t])
188 |
189 | AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK
190 | AC_CHECK_FUNCS([floor memset strchr strdup strerror gettimeofday lstat])
191 |
192 | AC_CONFIG_FILES([Makefile])
193 | AC_OUTPUT
194 |
195 | AM_CONDITIONAL([ENABLE_CAIRO], [test "$enable_cairo" = "true"])
196 | AM_CONDITIONAL([ENABLE_OPENGL], [test "$enable_opengl" = "true"])
197 | AM_CONDITIONAL([ENABLE_UI], [test "$enable_ui" = "true"])
198 | AM_CONDITIONAL([ENABLE_X11], [test "$enable_x11" = "true"])
199 |
200 | AC_MSG_RESULT([
201 |
202 | configuration summary:
203 |
204 | - Package version: $PACKAGE $VERSION
205 | - Prefix: ${prefix}
206 | - Database backend: ${with_db_backend}
207 | - X11 support: ${enable_x11}
208 | - OpenGL support: ${enable_opengl}
209 | - UI (ncurses) support: ${enable_ui}
210 | - Graph cairo support: ${enable_cairo}
211 |
212 | ])
213 |
214 | # End
215 |
216 |
--------------------------------------------------------------------------------
/debian/changelog:
--------------------------------------------------------------------------------
1 | duc (1.4.4-1) unstable; urgency=medium
2 |
3 | * New upstream version.
4 | * Bump standards version.
5 | * Move to debhelper 12.
6 |
7 | -- Jonathan Dowland Wed, 06 May 2020 16:20:12 +0100
8 |
9 | duc (1.4.3-6) unstable; urgency=medium
10 |
11 | * Fix FTBFS (dh_installman: Cannot find "debian/build-nox/doc/duc.1").
12 | (Closes: #924473)
13 |
14 | -- Bruno Kleinert Sun, 17 Mar 2019 18:55:56 +0100
15 |
16 | duc (1.4.3-5) unstable; urgency=medium
17 |
18 | [Ondřej Nový]
19 | * d/copyright: Use https protocol in Format field
20 | * d/rules: Remove trailing whitespaces
21 |
22 | [Helmut Grohne]
23 | * Address FTCBFS: Let dh_auto_configure pass --host to ./configure.
24 | (Closes: #915595)
25 |
26 | -- Helmut Grohne Wed, 05 Dec 2018 06:24:22 +0100
27 |
28 | duc (1.4.3-4) unstable; urgency=medium
29 |
30 | * Update Vcs-* headers to reflect migration from Alioth to Salsa.
31 | * Change B-D on ruby-conn to conn. Thanks Helmut Grohne. Closes: #903067.
32 | * Bump standards version (no other changes)
33 |
34 | -- Jonathan Dowland Thu, 05 Jul 2018 21:58:21 +0100
35 |
36 | duc (1.4.3-3) unstable; urgency=medium
37 |
38 | * Adopt duc. Thank you Herbert Parentes Fortes Neto for all your hard
39 | work and best wishes for the future! Closes: #886013.
40 | * Bump standards version (no further changes needed)
41 | * duc-nox provides /usr/bin/duc and the duc and duc-nox packages now
42 | conflict with each other. Closes: #885404.
43 | * Add a compatibility symlink for duc-nox.
44 | * Remove empty debian/patches/series
45 | * Revert src/libduc-graph/font.c to upstream version (DOS line endings)
46 | to keep dpkg-source happy.
47 |
48 | -- Jonathan Dowland Tue, 02 Jan 2018 16:12:09 +0000
49 |
50 | duc (1.4.3-2) unstable; urgency=medium
51 |
52 | * debian/control:
53 | - Add ruby-ronn to Build-Depends
54 | * debian/duc-nox.manpages:
55 | - Upstream manpage generated at build time.
56 | * debian/man removed.
57 | * debian/rules:
58 | - generate duc-nox manpage
59 |
60 | -- Herbert Parentes Fortes Neto Mon, 30 Jan 2017 10:55:43 -0200
61 |
62 | duc (1.4.3-1) unstable; urgency=medium
63 |
64 | * New upstream release.
65 | * debian/copyright:
66 | - Updated.
67 | * debian/man:
68 | - Refresh duc-nox manpage.
69 |
70 | -- Herbert Parentes Fortes Neto Mon, 30 Jan 2017 10:33:18 -0200
71 |
72 | duc (1.4.2-1) unstable; urgency=medium
73 |
74 | * New upstream release.
75 | * debian/man/duc-nox.1:
76 | - Refresh file.
77 | * debian/patches:
78 | - all patches applied by the upstream.
79 | * debian/rules:
80 | - dh_auto_configure:
81 | - Add '-fPIE' to CFLAGS.
82 | - Add '-fPIE -pie' to LDFLAGS.
83 |
84 | -- Herbert Parentes Fortes Neto Sat, 26 Nov 2016 08:46:56 -0200
85 |
86 | duc (1.4.1-4) unstable; urgency=medium
87 |
88 | * debian/control:
89 | - Update my email.
90 | * debian/copyright:
91 | - Update my email
92 | * debian/man:
93 | - Fix typo in duc-nox.txt and generate a new duc-nox.1
94 | * debian/patches:
95 | - Create fix-typo-manpage.patch. duc.1
96 | - Create fix-typo-cmd-cgi-c.patch.
97 |
98 | -- Herbert Parentes Fortes Neto Sat, 05 Nov 2016 12:24:11 -0200
99 |
100 | duc (1.4.1-3) unstable; urgency=medium
101 |
102 | * debian/control:
103 | - bump Standards-Version from 3.9.7 to 3.9.8
104 | * debian/copyright:
105 | - License other_1 renamed to Expat.
106 |
107 | -- Herbert Parentes Fortes Neto Sun, 19 Jun 2016 15:28:07 -0300
108 |
109 | duc (1.4.1-2) unstable; urgency=low
110 |
111 | * debian/patches:
112 | - ftbfs_hurd-i386.patch file created.
113 |
114 | -- Herbert Parentes Fortes Neto Sat, 02 Apr 2016 17:18:35 -0300
115 |
116 | duc (1.4.1-1) unstable; urgency=low
117 |
118 | * New upstream release.
119 | * debian/man/* updated.
120 |
121 | -- Herbert Parentes Fortes Neto Tue, 22 Mar 2016 13:48:45 -0300
122 |
123 | duc (1.4.0-1) unstable; urgency=low
124 |
125 | * New upstream release.
126 | * debian/control:
127 | - dh-autoreconf added to Build-Depends field.
128 | - Bump Standards-Version to 3.9.7.
129 | - Vcs-* fields using https.
130 | * debian/copyright updated.
131 | * debian/duc*.examples created.
132 | * debian/man/* updated to version 1.4.0.
133 | * debian/patches:
134 | - fix_typo_cmd-index.patch created.
135 | - fix_typo_libduc_duc.patch created.
136 | * debian/rules:
137 | - '--with autoreconf' param added.
138 | - set '--prefix=/usr' as a install dir.
139 | - two lines added to 'cp src/glad' to where the build is done.
140 | * debian/watch:
141 | - version 4.
142 |
143 | -- Herbert Parentes Fortes Neto Wed, 09 Mar 2016 15:06:01 -0300
144 |
145 | duc (1.3.3-1) unstable; urgency=medium
146 |
147 | * Initial release (Closes: #783310)
148 |
149 | -- Herbert Parentes Fortes Neto Sun, 21 Jun 2015 11:06:54 -0300
150 |
--------------------------------------------------------------------------------
/debian/compat:
--------------------------------------------------------------------------------
1 | 12
2 |
--------------------------------------------------------------------------------
/debian/control:
--------------------------------------------------------------------------------
1 | Source: duc
2 | Section: utils
3 | Priority: optional
4 | Maintainer: Jonathan Dowland
5 | Build-Depends: debhelper (>= 12),
6 | libcairo2-dev,
7 | libncursesw5-dev,
8 | libpango1.0-dev,
9 | libtokyocabinet-dev,
10 | ronn,
11 | txt2man
12 | Standards-Version: 4.5.0
13 | Homepage: http://duc.zevv.nl/
14 | Vcs-Git: https://salsa.debian.org/debian/duc.git
15 | Vcs-Browser: https://salsa.debian.org/debian/duc
16 |
17 | Package: duc-nox
18 | Architecture: any
19 | Depends: ${misc:Depends}, ${shlibs:Depends}
20 | Conflicts: duc
21 | Description: high-performance disk usage analyzer (without X support)
22 | Duc maintains a database of accumulated sizes of directories of the file
23 | system, and allows you to query this database with some tools.
24 | .
25 | Duc comes with console utilities, ncursesw and a CGI wrapper for disk
26 | usage querying and visualisation.
27 | .
28 | Duc is designed to scale to huge filesystems: it will index and display
29 | hundreds of millions of files on petabytes of storage without problems.
30 | .
31 | This package provides the console version of the duc.
32 |
33 | Package: duc
34 | Architecture: any
35 | Depends: ${misc:Depends}, ${shlibs:Depends}
36 | Conflicts: duc-nox (>= 1.4.3-3)
37 | Description: high-performance disk usage analyzer
38 | Duc maintains a database of accumulated sizes of directories of the file
39 | system, and allows you to query this database with some tools, or create
40 | fancy graphs showing you where your bytes are.
41 | .
42 | Duc comes with console utilities, ncursesw and X11 user interfaces and a
43 | CGI wrapper for disk usage querying and visualisation.
44 | .
45 | Duc is designed to scale to huge filesystems: it will index and display
46 | hundreds of millions of files on petabytes of storage without problems.
47 |
--------------------------------------------------------------------------------
/debian/copyright:
--------------------------------------------------------------------------------
1 | Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
2 | Upstream-Name: duc
3 | Source: https://github.com/zevv/duc/releases
4 |
5 | Files: *
6 | Copyright: 2014-2017 Ico Doornekamp
7 | 2014-2017 John Stoffel
8 | License: GPL-2
9 |
10 | Files: src/glad/KHR/khrplatform.h
11 | Copyright: 2008-2009 The Khronos Group Inc.
12 | License: Expat
13 |
14 | Files: src/libduc/utlist.h
15 | src/libduc/uthash.h
16 | src/libduc/utstring.h
17 | Copyright: 2003-2014 Troy D. Hanson
18 | License: BSD-1-Clause
19 |
20 | Files: src/libduc/varint.c
21 | Copyright: 2012 ?
22 | License: other
23 |
24 | Files: debian/*
25 | Copyright: 2015-2017 Herbert Parentes Fortes Neto
26 | License: GPL-2+
27 |
28 | License: GPL-2 or GPL-2+
29 | This package is free software; you can redistribute it and/or modify
30 | it under the terms of the GNU General Public License as published by
31 | the Free Software Foundation; either version 2 of the License, or
32 | (at your option) any later version.
33 | .
34 | This package is distributed in the hope that it will be useful,
35 | but WITHOUT ANY WARRANTY; without even the implied warranty of
36 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
37 | GNU General Public License for more details.
38 | .
39 | You should have received a copy of the GNU General Public License
40 | along with this program. If not, see
41 | .
42 | On Debian systems, the complete text of the GNU General
43 | Public License version 2 can be found in "/usr/share/common-licenses/GPL-2".
44 |
45 | License: BSD-1-Clause
46 | Redistribution and use in source and binary forms, with or without
47 | modification, are permitted provided that the following conditions are met:
48 | .
49 | * Redistributions of source code must retain the above copyright
50 | notice, this list of conditions and the following disclaimer.
51 | .
52 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
53 | IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
54 | TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
55 | PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
56 | OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
57 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
58 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
59 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
60 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
61 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
62 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
63 |
64 | License: other
65 | The authors renounce all claim of copyright to this code and dedicate
66 | this code to the public domain. In place of legal notice, here is
67 | a blessing:
68 | .
69 | May you do good and not evil.
70 | May you find forgiveness for yourself and forgive others.
71 | May you share freely, never taking more than you give.
72 |
73 | License: Expat
74 | Permission is hereby granted, free of charge, to any person obtaining a
75 | copy of this software and/or associated documentation files (the
76 | "Materials"), to deal in the Materials without restriction, including
77 | without limitation the rights to use, copy, modify, merge, publish,
78 | distribute, sublicense, and/or sell copies of the Materials, and to
79 | permit persons to whom the Materials are furnished to do so, subject to
80 | the following conditions:
81 | .
82 | The above copyright notice and this permission notice shall be included
83 | in all copies or substantial portions of the Materials.
84 | .
85 | THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
86 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
87 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
88 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
89 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
90 | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
91 | MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
92 |
--------------------------------------------------------------------------------
/debian/duc-nox.examples:
--------------------------------------------------------------------------------
1 | examples/ducrc
2 |
--------------------------------------------------------------------------------
/debian/duc-nox.install:
--------------------------------------------------------------------------------
1 | debian/build-nox/duc usr/bin
2 |
--------------------------------------------------------------------------------
/debian/duc-nox.links:
--------------------------------------------------------------------------------
1 | usr/bin/duc usr/bin/duc-nox
2 | usr/share/man/man1/duc.1.gz usr/share/man/man1/duc-nox.1.gz
3 |
--------------------------------------------------------------------------------
/debian/duc-nox.manpages:
--------------------------------------------------------------------------------
1 | debian/build-nox.inst/usr/share/man/man1/duc.1
2 |
--------------------------------------------------------------------------------
/debian/duc.examples:
--------------------------------------------------------------------------------
1 | examples/ducrc
2 |
--------------------------------------------------------------------------------
/debian/duc.install:
--------------------------------------------------------------------------------
1 | debian/build/duc usr/bin
2 |
--------------------------------------------------------------------------------
/debian/duc.manpages:
--------------------------------------------------------------------------------
1 | doc/duc.1
2 |
--------------------------------------------------------------------------------
/debian/rules:
--------------------------------------------------------------------------------
1 | #!/usr/bin/make -f
2 |
3 | #DH_VERBOSE = 1
4 |
5 | export DEB_BUILD_MAINT_OPTIONS = hardening=+all
6 | export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed
7 |
8 | FLAGS_duc:=--enable-dependency-tracking
9 | FLAGS_duc-nox:=--enable-dependency-tracking
10 | FLAGS_duc-nox+=--disable-cairo
11 | FLAGS_duc-nox+=--disable-x11
12 |
13 | BUILDDIR := $(CURDIR)/debian/build
14 | BUILDDIR_NOX := $(CURDIR)/debian/build-nox
15 |
16 | %:
17 | dh $@
18 |
19 | override_dh_auto_configure:
20 | dh_auto_configure --builddirectory=$(BUILDDIR) -- $(FLAGS_duc) CFLAGS="$(CFLAGS) -fPIE" LDFLAGS="$(LDFLAGS) -fPIE -pie"
21 | dh_auto_configure --builddirectory=$(BUILDDIR_NOX) -- $(FLAGS_duc-nox) CFLAGS="$(CFLAGS) -fPIE" LDFLAGS="$(LDFLAGS) -fPIE -pie"
22 |
23 | override_dh_auto_build:
24 | cp -r src/glad/* $(BUILDDIR)/src/glad/
25 | cp -r src/glad/* $(BUILDDIR_NOX)/src/glad/
26 | cp src/libduc/*.h $(BUILDDIR)/src/libduc/
27 | cp src/libduc/*.h $(BUILDDIR_NOX)/src/libduc/
28 | cp src/libduc-graph/*.h $(BUILDDIR)/src/libduc-graph/
29 | cp src/libduc-graph/*.h $(BUILDDIR_NOX)/src/libduc-graph/
30 | dh_auto_build -a -- -C $(BUILDDIR)
31 | dh_auto_build -a -- -C $(BUILDDIR_NOX)/src
32 |
33 | override_dh_auto_install:
34 | $(MAKE) -C $(BUILDDIR) install DESTDIR=$(BUILDDIR).inst
35 | $(MAKE) -C $(BUILDDIR_NOX) install DESTDIR=$(BUILDDIR_NOX).inst
36 | cp -r doc $(BUILDDIR_NOX)/
37 | rm -f $(BUILDDIR_NOX)/doc/duc.1
38 | $(MAKE) -C $(BUILDDIR_NOX)/doc
39 |
40 | override_dh_auto_clean:
41 | dh_clean
42 | rm -fr $(BUILDDIR) $(BUILDDIR_NOX)
43 | rm -fr debian/*.inst
44 |
--------------------------------------------------------------------------------
/debian/source/format:
--------------------------------------------------------------------------------
1 | 3.0 (quilt)
2 |
--------------------------------------------------------------------------------
/debian/watch:
--------------------------------------------------------------------------------
1 | version=4
2 | https://github.com/zevv/duc/releases .*/archive/v?(\d\S+)\.tar\.(?:gz|bz2|xz)
3 |
--------------------------------------------------------------------------------
/doc/Makefile:
--------------------------------------------------------------------------------
1 |
2 | duc.1 duc.html: manual.txt ../duc
3 | ../duc manual > options.txt
4 | sed -e "/>>>>/r options.txt" -e "//d" < manual.txt > duc.md
5 | ronn --style=toc,80c duc.md
6 |
7 | clean:
8 | rm -f options.txt
9 |
--------------------------------------------------------------------------------
/examples/duc.css:
--------------------------------------------------------------------------------
1 |
38 |
39 |
40 |
--------------------------------------------------------------------------------
/examples/ducrc:
--------------------------------------------------------------------------------
1 |
2 | #
3 | # This is an example configuration file for duc. Each section holds the options
4 | # for the duc subcommand with the same name. The [global] section holds options
5 | # which are passed to all subcommands.
6 | #
7 | # This example configuration file does not list all available options, but is
8 | # only meant as a starting point. For a list of available options and their
9 | # meaning, run 'duc help --all'.
10 | #
11 |
12 | [global]
13 |
14 | #
15 | # Enable the line below if you want to ensure duc always looks for duc.db
16 | # someplace globally accessible, for example if you plan to regularly run duc
17 | # index from cron.
18 | #
19 |
20 | # database /var/cache/duc.db
21 |
22 | #
23 | # Enable one of the options below to see more info during duc runs.
24 | #
25 |
26 | # verbose
27 | # debug
28 |
29 |
30 | [ls]
31 |
32 | recursive
33 | classify
34 |
35 |
36 | [index]
37 |
38 | exclude Cache
39 | exclude .ccache
40 |
41 |
42 | [gui]
43 |
44 | fuzz 0.7
45 | palette rainbow
46 | levels 7
47 |
48 |
49 |
--------------------------------------------------------------------------------
/examples/footer.htm:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/examples/header.htm:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
--------------------------------------------------------------------------------
/examples/index.cgi:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | #
3 | # Simple script to both generate simple CGI scripts for a bunch of duc databases, as well
4 | # as acting as the main index page to browse those DBs.
5 | #
6 | # When called from the CLI with the -g option, it will generate .cgi scripts in the $CWD.
7 | #
8 | # This is totally not secure or hardened against malicious actors! Only use internally in
9 | # a secured network you trust completely. You have been warned!
10 | #
11 | # Only tested with Apache, and you will need to make sure you have the +ExecCGI option setup,
12 | # and this file chmod +x as well.
13 | #
14 | # Author: John Stoffel (john@stoffel.org)
15 | # License: GPLv2
16 |
17 | mkcgi=0
18 |
19 | title="Disk Usage graphs"
20 | dbdir="/path/to/duc/dbs"
21 | wwwdir="/var/www/html"
22 | duc="/usr/local/bin/duc"
23 |
24 | # Sort index by time, or by db file name. It's just the arg to 'ls'
25 | sortby="-t"
26 |
27 | # If these are not empty, use these files in $wwwdir for the .cgi file's --header
28 | # and/or --footer options of 'duc cgi ...'.
29 | footer=""
30 | header=""
31 |
32 |
33 | # Option processing
34 | while getopts "g" opt; do
35 | case $opt in
36 | g)
37 | echo "Generating new cgi scripts in $CWD from DBs in $dbdir/."
38 | mkcgi=1
39 | ;;
40 | \?)
41 | echo "Invalid option: -$OPTARG" >&2
42 | ;;
43 | esac
44 | done
45 |
46 |
47 | # Now do the work,
48 | cd $dbdir
49 |
50 | if [ "$mkcgi" = "0" ]; then
51 | echo "Content-type: text/html"
52 | echo ""
53 | echo ""
54 | echo ""
58 | echo ""
59 | echo "$title"
60 | echo ""
61 | echo "
"
62 | echo "
"
63 | echo "
Path
"
64 | echo "
Size
"
65 | echo "
Files
"
66 | echo "
Dirs
"
67 | echo "
Date
"
68 | echo "
Time
"
69 | echo "
"
70 | echo ""
71 | fi
72 |
73 | for db in `ls $sortby *.db`
74 | do
75 | base=`echo $db | awk -F. '{print $1}'`
76 | array=(`$duc info -d ${db} | tail -1 `)
77 |
78 | if [ "$mkcgi" = "0" ]; then
79 | echo "