I was surprised that I could not create directorys on the local storage natively. I hate that it relies on FTP but it works.
Sharing for others.
# To reduce the security risk limit FTP to only connections from the device itself
set ftp disabled=no address=127.0.0.1/32;
# Create a user and group to grant access
/user group add name=ftp policy=ftp comment="Grants access to FTP";
/user add name=ftp_loopback group=ftp address=127.0.0.1/32 password="mypassword" comment="Used by scripts to FTP to the loopback interface to create directories";
# Now create the folder "/flash/ssh"
/tool fetch mode=ftp address=127.0.0.1 user=ftp_loopback password=mypassword src-path=doesnotexist dst-path=/flash/ssh/willnotexist;
This is an extract from a larger script that I might share later.