Code Monkey home page Code Monkey logo

amekkawi / diskusagereports Goto Github PK

View Code? Open in Web Editor NEW
67.0 67.0 19.0 5.85 MB

Disk Usage Reports is a web-based way to view disk usage on remote computers or servers, or to provide usage reports to users who store files on your server. Reports are stored as static JSON files which are retrieved via single HTML/AJAX web UI. No database or server-side scripting required.

Home Page: http://diskusagereports.com

License: MIT License

Shell 8.76% PHP 42.58% CSS 4.67% JavaScript 43.99%

diskusagereports's People

Contributors

amekkawi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

diskusagereports's Issues

offline web based diskusage report?

Would it be possible to allow us to paste output of ls in a browser and be able to navigate a report? Like an online ncdu version based on updated of ls?

hard-links

Can this be tweaked to only "count" hard-linked files once. I've got a server with a hard-linking system for backups, and diskusage is reporting that my 20gb drive has 50gb of space in use. Any ideas?

Error log

I'm generating a very big file:
--> Complete! Processed 673,208 lines from 107.86 MB (100.0%), wrote 116.89 MB in 78,913 files, took 305 seconds.

But when I try to open on the browser the message below appears:
Loading Directory List for Report...
Taking too long? You may skip the directory list but the directory tree on the left will not display.

If I click the link to skip an alert icon shows up but no error text

I have tested with small directories and It is working... I can see the tree and files statistics.

This is the command that I give to processes the data:
php $dir"scripts/process.php" $dir"data/" $dados -mt 20480000 -v
I'm using a very large number to generate the directory tree to avoid disabling it.

I would like to know How to enable error logging or debugging? Or how to solve this issue.

Thanks

new options needed

please inclue a Switch to disable writing the Headline.
With this someone could concatinate the results to a "virtual" scanfileresultfile from different places.

Next wish is to include a Prefixdir for the Output filenameinfo in result.
With this the result can be put into a "Prefixdirectory".
scan1 on c:\dir1 Output is:
Headline
dir
dir\file1

Scan2 on c:\dir2 Output is:
headline
file2

concat this is not good in Report
with Option -nh (no Headline) an -p "dir2" Output of scan2 would be
dir2\file2

concat this will Show in Report:
dir1\dir\file1
dir2\file2

that is better. so we can make a report from differnt server directorys put into one logical/virtual Report

UTF-8 filename issues

Hi,

I have some UTF-8 filenames, which doesn't get parsed and displayed correctly. Seems to me, there is somewhere an escaping issue.. Please see attached image. Browser encoding is correctly UTF-8..

issues

Excluding directory is not possible

Thanks for this tool is simple and easy to install.

I have a use case where we need to exclude directories in order to get the right reports.
However, this is not supported by the find.sh script.

So, I added a new '-x' option that exclude whole directory trees.

This is the patch: https://gist.github.com/4637496

Subdirectories showing up at top level

I have an odd problem which is that after generating my report, a lot of my sub directories end up showing up as top level directories in the report. In fact, I even have duplicates (sort of -- duplicate names that represent different subdirectories).

My directory structure is pretty huge:

Total Size: 2,114.7 GB
Total Files: 3,396,870

Looking at settings.txt, I definitely see duplicate names (with different hashes) which aren't at the top level, but exist as two directories lower down.

I'm not sure how to do any further debugging ...

cant run report for mounted nfs share

im getting this error on terminal when i try to run a report for my mounted nfs share

[root@list diskusage]# bash scripts/find.sh /vol/ | php scripts/process.php data /cha
Processed 29,600 lines from 4.92 MB, wrote 2.93 MB in 507 files, took 15 seconds.
Processed 63,800 lines from 10.22 MB, wrote 6.58 MB in 862 files, took 30 seconds.
Processed 91,200 lines from 13.68 MB, wrote 9.82 MB in 2,449 files, took 45 seconds.
Processed 124,300 lines from 17.87 MB, wrote 13.63 MB in 3,208 files, took 60 seconds.
Processed 150,500 lines from 21.37 MB, wrote 13.81 MB in 3,209 files, took 75 seconds.
Processed 176,400 lines from 24.83 MB, wrote 18.80 MB in 3,213 files, took 90 seconds.
Processed 202,100 lines from 28.26 MB, wrote 18.80 MB in 3,213 files, took 105 seconds.
Processed 227,300 lines from 31.62 MB, wrote 18.80 MB in 3,213 files, took 120 seconds.
Processed 251,800 lines from 34.89 MB, wrote 25.01 MB in 3,215 files, took 135 seconds.
Processed 277,600 lines from 38.34 MB, wrote 25.01 MB in 3,215 files, took 150 seconds.
Processed 303,800 lines from 41.84 MB, wrote 31.36 MB in 3,216 files, took 165 seconds.
Processed 337,900 lines from 46.39 MB, wrote 31.36 MB in 3,216 files, took 180 seconds.
Processed 371,900 lines from 50.93 MB, wrote 31.36 MB in 3,216 files, took 195 seconds.
Used 80% of memory limit (128M)
Used 81% of memory limit (128M)
Used 82% of memory limit (128M)
Used 83% of memory limit (128M)
Used 84% of memory limit (128M)
Used 85% of memory limit (128M)
Used 86% of memory limit (128M)
Used 87% of memory limit (128M)
Used 88% of memory limit (128M)
Used 89% of memory limit (128M)
Processed 404,900 lines from 55.34 MB, wrote 31.36 MB in 3,216 files, took 210 seconds.
Used 90% of memory limit (128M)
Used 91% of memory limit (128M)
Used 92% of memory limit (128M)
Used 93% of memory limit (128M)
Used 94% of memory limit (128M)
Used 95% of memory limit (128M)
Used 96% of memory limit (128M)
PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 268 bytes) in /var/www/html/diskusage/scripts/inc/functions.inc.php on line 50
xargs: ls: terminated by signal 13
[root@list diskusage]#

any help would be greatly appreciated

many thanks,

rob

Processing broken under PHP 8.1 after Ubuntu release upgrade

This project broke for me after migration from Ubuntu 20.04 to 22.04. I think the default PHP version was bumped from 7 to 8 as part of this upgrade which is likely responsible.

$ php -v
PHP 8.1.2-1ubuntu2.9 (cli) (built: Oct 19 2022 14:58:09) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.1.2, Copyright (c) Zend Technologies
    with Zend OPcache v8.1.2-1ubuntu2.9, Copyright (c), by Zend Technologies

I'm getting the following error:

$ /bin/bash find.sh /data/share/downloads/ > /tmp/find.txt
$ cat /tmp/find.txt | /usr/bin/php process.php -v -vv /tmp/report
PHP Warning:  "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in /home/jeff/sources/diskusagereports/scripts/process.php on line 286
  Processing filelist...
  Processing header...
FAIL: The header line in the <filelist> is invalid:
#

I'm no expert in php, but I found that after making the following changes I was able to get it to work:

  • Class constructors need to use __construct() or else they don't run
  • The comparator function needs to be static or this throws an error
  • Switch to break instead of continue inside switch (fix warning)

After making these changes the report appears to be generated correctly.

cat /tmp/find.txt | /usr/bin/php process.php -v /data/media/test/report
  Processing filelist...
  Saving dir tree...
  Saving settings...
  Complete! Processed 6,762 lines from 810.04 KB, wrote 1.61 MB in 1,056 files, took 0 seconds.

I will submit these fixes as a pull request. I'm not sure if this project is still maintained but even if not hopefully this will save someone else some debugging time.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.