To schedule a bash file to automatically run once eg. after a reboot, you could use this, see https://vmware.github.io/photon/assets/files/html/3.0/photon_admin/creating-a-startup-service.html.
Generally, you must create a service file in which you declare what has to be done as "at" one. In the following sample it is simply a bash file which is configured to run once.
# --- 1) create a bash file with content as preparation for the service (see 2). The last part in the bash file direclty disables and unlinks the service.
BASHFILE="/root/mysample.sh"
cat > $BASHFILE <<'EOF'
#!/bin/sh
# INSERT YOUR CODE
systemctl disable mysample.service
rm /lib/systemd/system/multi-user.target.wants/mysample.service
unlink /lib/systemd/system/mysample.service
EOF
# --- 2) make the bash file executable and create the service file. The type of [Service] is configured to 'oneshot'. The Unit dependencies 'after' and 'wants' - in this case- it has a environment dependency to a service called waagent.service. This is optional.
chmod a+x $BASHFILE
cat << EOF1 >> /lib/systemd/system/mysample.service
[Unit]
Description=Run a bash file
After=waagent.service
Wants=waagent.service
[Service]
ExecStart=$BASHFILE
Type=oneshot
[Install]
WantedBy=multi-user.target
EOF1
cd /lib/systemd/system/multi-user.target.wants/
ln -s ../mysample.service mysample.service
# --- 3) 'ln -s' together with the service file allows to simply use the created service within systemctl.
Hope this helps.