Just make a cron script (see https://developer.apple.com/legacy/library/documentation/Darwin/Reference/ManPages/man5/crontab.5.html#//apple_ref/doc/man/5/crontab)

So for example

@reboot /my/expand/script

Just be sure to delete the cron entry after it runs (you can probably make the script do this).