Tenou
Cadet
- Joined
- Jan 22, 2020
- Messages
- 9
Hello folks,
I'm currently trying to automate my TrueNAS install (currently running 12.0-U4) to shutdown after it was reliably determined that all scheduled replication tasks have finished successfully.
I had the plan to let the system start up through an IPMI command fifteen minutes before the tasks are scheduled to run, execute a short SMART-test, wait for the replication tasks to begin (they all start at the same time, at 4AM) and shutdown the system afterwards. If the replication task failed, I'd like to have the option to keep the system running until an administrator could determine what's the issue.
The best I could come up with so far was to look if this command has given an output in the last minute:
However, since every snapshot gets it's own process wich run sequentially, I do not trust this to be reliable enough, in case there should be a larger time between two jobs.
Has anyone a more reliable - or in general nicer - way to monitor progress and eventually results as well? In the end, it's all stuff that can be seen in the WebUI, so it should be possible to somehow be accessed from the CLI as well... right?
I'm currently trying to automate my TrueNAS install (currently running 12.0-U4) to shutdown after it was reliably determined that all scheduled replication tasks have finished successfully.
I had the plan to let the system start up through an IPMI command fifteen minutes before the tasks are scheduled to run, execute a short SMART-test, wait for the replication tasks to begin (they all start at the same time, at 4AM) and shutdown the system afterwards. If the replication task failed, I'd like to have the option to keep the system running until an administrator could determine what's the issue.
The best I could come up with so far was to look if this command has given an output in the last minute:
Code:
ps -U root -axwwo lstart,command | grep 'python3 -u /tmp/zettarepl' | grep -v grep | grep -v middlewared
However, since every snapshot gets it's own process wich run sequentially, I do not trust this to be reliable enough, in case there should be a larger time between two jobs.
Has anyone a more reliable - or in general nicer - way to monitor progress and eventually results as well? In the end, it's all stuff that can be seen in the WebUI, so it should be possible to somehow be accessed from the CLI as well... right?