Sorry for the confustion, I don't know the answer to your save question.
I am suggesting that instead of having your management system run a script logging into the device you add these configuration lines to the device and it will automatically transfer a copy of the configuration every day to the server you configure.
set system archival configuration transfer-interval 1440
set system archival configuration archive-sites scp://user@host:/path password userpassword
scp / ftp both are supported
file is automatically named with host date and time
hostname_20180629_054625