aboutsummaryrefslogtreecommitdiff
path: root/README
blob: c28bd3b83677e128571e8ff25b4b64b005797986 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
I regularly amass a mass of junk files in my ~/public_html that I don't need.
Most of these were uploaded to share something on IRC / email / IM, and aren't
needed after some number of days.

To address this, I wrote a small garbage collector in C. Its file retention
period is shamelessly stolen from the kind folks at <http://0x0.st/> and
<https://ttm.sh/>, with the exception that files larger than max_size are kept
for a fxed number of days before being deleted.

SETUP:

    Edit the paths in cleanup.c
    compile cleanup.c: gcc -o tmpclean -lm cleanup.c
    add a daily cronjob that calls cleanup

USAGE:

    cleanup
        -v verbose
        -n dry run
        -x filename
            exclude filename from cleanup

TO UPLOAD:

    I have a flaky shell script 'ptmp' that scps files to the right directory
    with a temporary filename.