I execute the following command from a cron job running as root:
virtualmin import-database --domain $domain --name $dbName --type mysql
Where the variables are obviously replaced with relevant data. Interestingly, if I execute the PHP script with this code manually (running as sudo), the job executes just fine and the database is imported into Virtualmin. However, if the cron job, which is setup through Webmin and set to run as root, kicks off this script, this call returns a “127”.
I haven’t been able to find any documentation on what a 127 error might be, but I need this database to import from the cron. Any help would be most appreciated!
Also, after the cron fails (but the database was successfully created via the script, so it clearly is running as root), I can go into the Virtualmin UI, go to Import Database, and import the database just fine manually.