sudo -u apache php admin/tool/task/cli/scheduled_task.php Could not open input file

sudo -u apache php admin/tool/task/cli/scheduled_task.php Could not open input file

by Diane Soini -
Number of replies: 3

What am I missing? Why can I not run this command-line script?

sudo -u apache php scheduled_task.php --help
ls -l
-rw-r--r-- 1 root root 6335 Mar 28 09:32 schedule_task.php

apache can run php without specifying the full path.

I have run this scheduled_task.php script in the past.

I've tried changing the permissions/ownership on the script to no effect.

I've tried specifying the full path to both php and the script to no effect.

I've launched the interactive php (php -a) as the apache user successfully.

sudo -u apache less scheduled_task.php   <-- This works.

What am I missing???

Average of ratings: -
In reply to Diane Soini

Re: sudo -u apache php admin/tool/task/cli/scheduled_task.php Could not open input file

by Diane Soini -
Oh god I'm so dumb. It's "schedule_task.php" not "scheduled_task.php".

Nothing to see here. Move along.
In reply to Diane Soini

Re: Re: sudo -u apache php admin/tool/task/cli/scheduled_task.php Could not open input file

by Ken Task -
Picture of Particularly helpful Moodlers

Actually, Diane, there is "something to see" and fix ... fell victim to the very same thing.

The help screen for the script is what led to your (and mine) mistake.   I copied and pasted without checking.   Result .. same as yours.

So ... the help for the script needs to be changed to provide the right name of the script.

But glad you sorted it out. smile

'SoS', Ken


In reply to Ken Task

Re: Re: Re: sudo -u apache php admin/tool/task/cli/scheduled_task.php Could not open input file

by Diane Soini -
I'll submit a bug report. I didn't realize the help was feeding me the misspelling.