Hello everyone,
I'm using TrueNAS as a backup storage device in my private network. Since a full backup once a week takes about 4 hours (increments only 10 mins), I prefer not to keep the device running all day long to save energy. Instead, I use a Wake-on-LAN script to start the backup process when needed.
Previously, I was using SMB and had a working script that checked for "DENY_NONE" and locked files in "/usr/local/bin/smbstatus". The script ran every minute and scheduled a shutdown in 15 minutes if there were no locked files. However, if a file was locked within the 15-minute period, the shutdown was canceled to prevent data loss.
Now, I've switched to NFS for better performance, but I'm facing some difficulties in implementing a similar script. The "nfsstat" command only provides statistics, and "showmount" doesn't give any output. Also, the solution I found in a 2014 forum post regarding open files and lsof does not work due to fstab's limitations and lack of ZFS support.
I'm looking for suggestions on how to implement a similar script with NFS or any other approach that could help me achieve the same goal. Any advice or insight would be greatly appreciated.
Thank you.
I'm using TrueNAS as a backup storage device in my private network. Since a full backup once a week takes about 4 hours (increments only 10 mins), I prefer not to keep the device running all day long to save energy. Instead, I use a Wake-on-LAN script to start the backup process when needed.
Previously, I was using SMB and had a working script that checked for "DENY_NONE" and locked files in "/usr/local/bin/smbstatus". The script ran every minute and scheduled a shutdown in 15 minutes if there were no locked files. However, if a file was locked within the 15-minute period, the shutdown was canceled to prevent data loss.
Now, I've switched to NFS for better performance, but I'm facing some difficulties in implementing a similar script. The "nfsstat" command only provides statistics, and "showmount" doesn't give any output. Also, the solution I found in a 2014 forum post regarding open files and lsof does not work due to fstab's limitations and lack of ZFS support.
I'm looking for suggestions on how to implement a similar script with NFS or any other approach that could help me achieve the same goal. Any advice or insight would be greatly appreciated.
Thank you.