Diskspace plugin refresh time

simur612

Member
May 25, 2018
879
0
16
Hi, Can someone tell me where can I change(lower) the refresh interval for Diskspace plugin ?
 

peshua19

Member
May 25, 2018
897
0
16
Ahhh, that's bad. I need to make it refresh more rarely, like every 5min, but without modifying gui refresh time
 

lisas4567

Member
May 25, 2018
773
0
16
why?


Even if you COULD modify this plugin it wouldn't change anything. The "space left" is part of the base install ANYWAYS on the GENERAL tab.
 

saroos1

Member
May 25, 2018
718
0
16
I've modified action.php so I can use du -sh command for reporting dir size, but executing du -sh every few seconds is too often on a busy system with 5-6 rtorrent instances.
 

simur612

Member
May 25, 2018
879
0
16
well you will need to write your own plugin then. This plugin polls based on the refresh rate of the client.


A better options might be to write a script which checks via du -sh every so often, outputs it to a text file, then use this info.
 

peshua19

Member
May 25, 2018
897
0
16
So I've got 2 text files, free.txt and used.txt which have the values.
How would I edit action.php to call these values instead?
 

simur612

Member
May 25, 2018
879
0
16
I want diskspace to show the top level directory size as defined in config.php

I have made a bash script which runs du -s via cron every 2 minutes

Code:
#!/bin/bash
DIRECTORY=/home/user1
SIZE=$(du -s $DIRECTORY | awk '{print $1}')
echo "$SIZE" > /home/user1/used.txt
Another similar script will check that users quota making the file "available.txt"

Now I need to change the action.php in the diskspace plugin to read these values from the 2 text files which are stored in the users top directory as specified in config.php.

This will change the way diskspace reports, from reading the full partition size to just showing a directory size.