Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Calculate disk share size externally

Featured Replies

Looking to run some code on an external host to calculate my local unraid disk size etc. This is some code I've done in PHP, however I do not think it's possible to do this remotely with this technique. Anyone have any ideas or suggestions?

 

<?php

$dt = disk_total_space( '/mnt/cache' );
$df = disk_free_space( '/mnt/cache' );

$du = $dt - $df;
$dp = sprintf( '%.2f', ( $du / $dt ) * 100 );
$df = formatSize( $df );
$du = formatSize( $du );
$dt = formatSize( $dt );

function formatSize( $bytes ) {
  $types = array( 'B', 'KB', 'MB', 'GB', 'TB' );
  for ( $i = 0; $bytes >= 1024 && $i < ( count( $types ) - 1 ); $bytes /= 1024, $i++ );
  return ( round( $bytes, 2 ) . " " . $types[ $i ] );
}

?>



 

  • Author

BUMP

First off, /mnt/cache doesn't exist remotely and you'd have to do it via an smb share

  • Author
On 5/6/2020 at 7:06 AM, Squid said:

First off, /mnt/cache doesn't exist remotely and you'd have to do it via an smb share

Yes, I understand that. It was just an example because I am almost certain using that PHP code it does not pull external values. 

Anyone have any idea how to pull those values remotely? Also maybe like uptime counter?

Thanks

  • Author

Anyone have any ideas? Just want to be able to pull my share size spaced used and remaining..

  • Author

Ok, so I can do it directly on the server instead of remotely. I already have a reverse proxy setup with nginx and php functioning, however it does not seem to be able to access /mnt/user/SHARE for calculations? 

What can I do to get the permissions right?

Thanks

If you're running this as a container, then you would have to add in appropriate path mappings to access /mnt/user from within the container.

Archived

This topic is now archived and is closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.