Root password in Cron jobs


(Davidc) #1

We're trying to set up cron jobs to run the recommended maintenance scripts for Matrix. Most of them require the root password to be entered. How do you suggest we implement this in a secure fashion?


Thanks,



David C


(Avi Miller) #2

None of the Cron Jobs that require the root password need to be run on a regular basis: Rather, they are for reactive maintenance, usually after a system upgrade or move. Could you let me know which scripts you're trying to run?


The only script that runs regularly is the Cron Manager script itself, which doesn't require any input.


(Davidc) #3

I was thinking about things like system_integrity_content_links.php, system_integrity_deleted_user_perms.php and system_integrity_orphaned_assets.php. The manual says they should be run weekly, and they interactively ask for a password.


Regards,



David C


(Davidc) #4

Also, speaking of these scripts, we are having memory problems running some of them (and our website is running slow, despite the fact the box is straining at all, so we wonder if that's a memory problem too).


You mentioned the core/web/index.php file in a previous post, and we have that set to 64M. Does that seem reasonable?


(Luke Wright) #5

[quote]Also, speaking of these scripts, we are having memory problems running some of them (and our website is running slow, despite the fact the box is straining at all, so we wonder if that’s a memory problem too).


You mentioned the core/web/index.php file in a previous post, and we have that set to 64M. Does that seem reasonable?

[right][post=“7582”]<{POST_SNAPBACK}>[/post][/right][/quote]



The setting in core/web/index.php does not affect the script files. This leaves you at the mercy of the setting in your CLI install’s php.ini, which is typically set to 8 MB - and this typically isn’t enough in most cases.



If you’re not using it for anything else, you can edit CLI’s php.ini to increase the memory_limit value to something higher - start with 16 MB (‘16M’), if that isn’t enough then I’d advise to try increasing it in lots of 8 MB.



If you can’t or don’t want to edit that, you can try adding this to the top of the affected script (after the licence comment) - then change the memory limit if you need to increase it:

    ini_set('memory_limit', '16M');

(Davidc) #6

Hi. Any thoughts on the password in those php scripts?

(Greg Sherwood) #7

You don't need to run those scripts as a cron job. You only need to run them if your system gets into a state where you think a system-wide fix may be needed.


(Avi Miller) #8

Greg, can we raise a call to the Documentation Team to check why its recommended these scripts be run weekly? We should probably remove that from the docs. :slight_smile:


(Greg Sherwood) #9

I've let them know and they are going to change the manual.