Hi,
I'm having some problems with some of the scripts provided with MSM.
We'd like to run purge_trash.php on a regular basis from cron - however the script prompts for the MSM root password from the keyboard. Does anyone have any suggestions on how to provide the password to the script without using the keyboard so it can be run from cron? - A hack I could put in myself would be to change the lines:
echo 'Enter the root password for "'.SQ_CONF_SYSTEM_NAME.'": ';
$root_password = rtrim(fgets(STDIN, 4094));
to
$root_password = (isset($_SERVER['argv'][3])) ? $_SERVER['argv'][3] : '';
Or similar so it could be specified as a command line argument (accepting the security issues about providing your password in clear text in a cron job…)
But I'd rather not put in a local hack to a script that distributed with MSM.
Also since upgrading to 3.22.0 last night I'm having trouble with the backup.sh script.
It now only seems to be doing a database schema backup rather than a full DB backup.
I had to change that script to get it to work - changing
#!/bin/sh
to
#!/bin/bash
and
for file in $(gfind "${sysroot_base}" \( -path "${sysroot_base}/cache" -o -path
"${sysroot_base}/data" \) -prune -o -type f -name '-backup.tar' -print); do
echo "${file}" >> ${mydir}/tar_exclude_list
(Note the "gfind" rather than find - so it is forced to use the GNU find rather than the OS built in find which is non-compatible.)
But these are the only two changes I've made. The old backup script from 3.20 works just fine - creates a full DB backup.
The OS is Solaris 10 - certainly the find command in backup.sh doesn't work with Solaris find (/usr/bin/find or indeed the /usr/xpg4/bin/find command the script tries to use)
I also had problems with the session_cleanup.sh script - again I had to change the shell from /bin/sh to /bin/bash and change the find command to use GNU find before it would work.
Cheers
Submit a bug report for the backup script on Solaris and the maintainer will take a look into it.
For the cron trashing, you will have to hack up the script. It is not designed to run via cron.