GithubHelp home page GithubHelp logo

umich-arc / gufi-archive Goto Github PK

View Code? Open in Web Editor NEW
10.0 10.0 1.0 37 KB

Public Repo of documentation and scripts how to use GUFI to generate reports to identify data suitable for archive

Shell 59.22% HTML 40.78%

gufi-archive's People

Contributors

brockpalen avatar cjantonelli avatar rharolde avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

Forkers

clil16

gufi-archive's Issues

directory summary

list size and oldsize for each directory under a given starting point

Single call to get results

$BFQ -E " \
INSERT INTO sument select uid, name, size, atime, \
case when datetime(atime, 'unixepoch') < DATE('now', '-"$DAYS" day') then size else 0 end as oldsize \
FROM entries \
WHERE type='f';" \
-n $THREADS -O outdb \
-I "CREATE TABLE sument (username text, name text, size int64, atime int64, oldsize int64);" $1/$dir
a=`$QUERYDBS -d \| -V $gettitle outdb sument " \
select count, sizeGB, oldsize, \
PRINTF('%02d%%', (100*oldsize/sizeGB)) as percent \
FROM( \
SELECT COUNT(*) AS count, sum(size)/1024/1024/1024 AS sizeGB, sum(oldsize)/1024/1024/1024 as oldsize from vsument) \
ORDER BY sizeGB DESC;" \
outdb.*`

This can be changed to only use gufi_query

gufi_query \
       -n ${THREADS} \
       -I "CREATE TABLE sument (username text, name text, size int64, atime int64, oldsize int64);"  \
       -E "INSERT INTO sument SELECT uid, name, size, atime, \ 
 	    CASE WHEN datetime(atime, 'unixepoch') < DATE('now', '-"$DAYS" day') THEN size ELSE 0 END \ 
 	    FROM entries WHERE type='f';" \ 
       -K "CREATE TABLE vsument(count int64, sizeGB int64, oldsize int64);" \
       -J "INSERT INTO vsument SELECT COUNT(*), sum(size)/1024/1024/1024, sum(oldsize)/1024/1024/1024 FROM sument;" \
       -G "SELECT count, sizeGB, oldsize, PRINTF('%02d%%', (100*oldsize/sizeGB)) FROM vsument;" \
       "$1/${dir}"

No intermediate database files will be created. sument and vsument will be in memory. This also avoids the limit mentioned in the SQLite documentation that querydbs suffers from.

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.