Difference between revisions of "ZFS Appliance"

From dbawiki
Jump to: navigation, search
(Created page with "===List the sizes and available space in all filesystems on ZFS appliance=== * [https://docs.oracle.com/cd/E51475_01/html/E52872/user_interface__cli__scripting__interacting_wi...")
(No difference)

Revision as of 15:27, 9 January 2017

List the sizes and available space in all filesystems on ZFS appliance

Make sure to be in the root context before running this.

script
       run('shares');
       projects = list();

       printf('%-40s %-10s %-10s\n', 'SHARE', 'USED', 'AVAILABLE');

       for (i = 0; i < projects.length; i++) {
               run('select ' + projects[i]);
               shares = list();

               for (j = 0; j < shares.length; j++) {
                       run('select ' + shares[j]);

                       share = projects[i] + '/' + shares[j];
                       used = run('get space_data').split(/\s+/)[3];
                       avail = run('get space_available').split(/\s+/)[3];

                       printf('%-40s %-10s %-10s\n', share, used, avail);
                       run('cd ..');
               }

               run('cd ..');
       }
.