Trying to run this script below basically just a modified version of Spearfoot's rescan datastores. Doesn't appear to be working nothing written into the log and I know it works when I run it from the TrueNAS shell.
github.com
rescan.sh
utility-scripts-for-freenas-and-vmware-esxi/esxi-rescan-datastores.sh at master · Spearfoot/utility-scripts-for-freenas-and-vmware-esxi
All-In-One utility scripts for FreeNAS and VMware ESXi - Spearfoot/utility-scripts-for-freenas-and-vmware-esxi
rescan.sh
Code:
#!/bin/bash echo "$(date): Forcing datastore rescan on ESXi host 192.168.1.20" | tee -a "esxi-rescan-datastores.log" ssh -i esxi root@192.168.1.20 esxcli storage core adapter rescan --all && exit echo "Done"