Creating Init/Shutdown Scripts
2 minute read.Last Modified 2023-11-30 10:15 EST
TrueNAS can schedule commands or scripts to run at system startup or shutdown.
Go to Tasks > Init/Shutdown Scripts and click ADD.
Enter a Description, then select a Type.
You can also include the full path to a command in the entry.
Scheduled commands must be in the default path.
You can find the path to a command by entering
which COMMAND in the shell, where COMMAND is the command you want to locate.
When available, the path to the command displays:
[root@freenas ~]# which ls /bin/ls
Select when you want the Command to run and fill out the rest of the fields to your needs, then click SUBMIT.
Select when you want the Script to run and fill out the rest of the fields to your needs, then click SUBMIT.
Always test the script to verify it executes and achieves the desired results. All init/shutdown scripts are run with
All saved Init/Shutdown tasks are in Tasks > Init/Shutdown Scripts. Click (Options) next to a task to EDIT or DELETE that task.