Controlling a Scale EE system from a remote Linux (Weekly Backup - Spawning scripts etc...)

I’d like (if possible) , to control my Scale (EE) servers from a remote "Secured linux).

My current weekly backup schedule via Scale Cron:

On Saturday:

1: 
At 11:00 - Manually boot Primary & Secondary NAS
At 12:00 - Cron - Run rsync backup shell script - Takes around 3 hr.
At 16:00 - Make snapshot 1
                 Run "linked" replication to backup nas - Takes 3 minutes
At 16:15 -  Make snapshot 2
                 Run "linked" replication to backup nas - Takes ~2 hr

At 19:00 - Manually shutdown primary & secondary servers.
                 Wait 10 min - Then Cut power via APC Master PDU (Save IPMI/BMC Standby power)

My linux server local backups are done around 10:15
But i wait until 12:00 before starting the above rsync , in order to be sure they’re done.

I’d love to automate this.

I already have APC MasterPDU SNMP (turn-On/Off)automation ready

Any hints (examples) how to do that ??
Please don’t just link to the API pages …

In my mind Something like … The below

Hint to create an API Key.

Some TrueNas magic to “execute a rsync script” , wait for completion.

Make or spawn a snapshot + linked ZFS replication.
Wait for completion …

Make or spawn a snapshot + linked ZFS replication.
Wait for completion …

If (date > 25)
Spawn ZFS Scrub

Wait for completion
Wait 10 min
Shutdown

/Bingo