Electr0
Dabbler
- Joined
- Dec 18, 2020
- Messages
- 47
Hi All,
I have two systems running TrueNAS Core: TrueNAS (Main) and TrueNAS (Backup).
My Main system is up 24/7 however I just want to have my Backup system online for a few days a month.
I would like to do the following:
1. Remotely power on the Backup system
2. Replicate a Snapshot from my Main system
3. Scrub the pool on the Backup system (only if the last scrub was >35 days ago)
4. Perform SMART tests on all disks
5. Shutdown the Backup system
My plan was to wrap the commands below (2- 5) in a Bash script, and set it to run on Boot.
Each command would be on a new line, so successive commands should only complete once the previous command has finished. Correct?
1. Power On
I can do this by using the following command from my Main system (they're on the same network):
2. Replicate
I already have a replication task setup with an SSH connection to the Main system, so I belive I can just run it by using:
3. Scrub
Normally I could do this by running:
However, that would scrub the pool everytime the script was run. Is there a way via the CLI to check when the last scrub was run?
Then I could just use an
It seems like you can do this in TrueNAS SCALE through this CLI command
I checked the CORE API and it doesn't seem possible through that either.
4. SMART Tests
I believe I can run these for all disks in parallel by using the
5. Shutdown
Am I missing anything?
I have two systems running TrueNAS Core: TrueNAS (Main) and TrueNAS (Backup).
My Main system is up 24/7 however I just want to have my Backup system online for a few days a month.
I would like to do the following:
1. Remotely power on the Backup system
2. Replicate a Snapshot from my Main system
3. Scrub the pool on the Backup system (only if the last scrub was >35 days ago)
4. Perform SMART tests on all disks
5. Shutdown the Backup system
My plan was to wrap the commands below (2- 5) in a Bash script, and set it to run on Boot.
Each command would be on a new line, so successive commands should only complete once the previous command has finished. Correct?
1. Power On
I can do this by using the following command from my Main system (they're on the same network):
ipmitool -I lanplus -H <IP-Address> -U <Username> -P <Password> power on2. Replicate
I already have a replication task setup with an SSH connection to the Main system, so I belive I can just run it by using:
midclt call replication.run 13. Scrub
Normally I could do this by running:
zpool scrubHowever, that would scrub the pool everytime the script was run. Is there a way via the CLI to check when the last scrub was run?
Then I could just use an
IF command...It seems like you can do this in TrueNAS SCALE through this CLI command
scrub query, but that command doesn't exist in CORE.I checked the CORE API and it doesn't seem possible through that either.
4. SMART Tests
I believe I can run these for all disks in parallel by using the
smartctl command with the appropriate options.5. Shutdown
shutdown -h nowAm I missing anything?