How do I automatically turn on/off my remote backup TrueNAS?

Hello all,
I currently have 2 TrueNAS systems at play,
1 at home for my homelab needs, another at my parent’s house in a different city, used as a remote backup for my files

I’ve set up a proper remote backup using tailscale and truenas replication, and it works fine.

I want to improve the system by turning my system on and off during the backup periods.

I know technically I can use wake on LAN for this, but as a novice I have no idea how that works especially remotely.

I don’t mind getting more equipment, so long as it’s low power so I don’t rack up my parent’s electricity bill. Thanks in advanced!

(using 3rd gen intel for remote system, just in case that matters)

EDIT:
I awarded @dwolsten the note for tapo, but I also want to credit @oxyde for giving the idea to set up a time to close my job.

Since I don’t plan to add/remove data too much (Not more than 5-10gb at a time) I’m setting my tapo to turn on at 11:30PM for my Daily backup, then I’ve set a cron job to daily shutdown by 3am, and setting the tapo outlet to turn off at 3:15. That’s more than enough time for me personally

using the code: midclt call system.shutdown “reason.general”

I’ll update this if it has ruined any backup by having a wrong shutdown timing

Hi.

Not familiar with tailscale. But, if you can connect to the remote router via tailscale or VPN, it should have a WoL option in its GUI. At least my 10-year-old ASUS has it.

NIC must support WoL. Perhaps there can be other caveats in TrueNAS itself (never used WoL with it).

Get a Tapo smart plug, and plug your server into that. Then set up the BIOS on the machine so that it powers on whenever the power is turned on. You’ll be able to turn it on remotely with an app on your phone.

As a bonus, you can also see its realtime and historic power consumption.

Nice! I didn’t know tapo could rad power consumption that’s cool. With that said, I want to have a graceful shutdown for when the replication is done. Is there a way I can have it shutdown the TrueNAS? I guess also for additional context there are 4 different replications happening at the same time, since I’m replicating 4 different datasets

Perhaps not. You just access your remote truenas gui and shut it down from there.

I think that the only way to achieve this is to bypass the GUI replication task and setup a custom script that will handle both the replica and the shutdown.
If actually you are pulling from the backup system, you can place this script into the Init scripts section, so he starts automatically on system start up.
Or, more simple but way less accurate, shutdown the Nas sistematically after a certain amount of time

How do I do the 2nd one? realistically I’m not taking more than 3 hours to do snapshot backups haha

You can add a cronjob entry with a dayli schedule on the desidered hour, with just the shutdown command. Then your tapo device should cutt off power accordingly some time later, 5-10 min to be sure that the Nas has shutdown properly.

As i said before, this method Is not so “clean”. I have faced your same situation (remote replica on a cheap system at my parents home), at the end i was worried about all those power off-on for the disks and i decided that wasnt worth… I preferred build a really low power system (based on a mobile soc in a sff desktop), and keep It always on, 10w of idle power consumption were nothing (costs related)