0

Hi guys,

Trying to set up a cron job using this tutorial

I have replaced {my/magento/install} with my site path and tried to execute it as a unix command.

/usr/bin cd /{/var/sites/e/mysite.com}/shell/; php -f attributeimport.php -- --attribute manufacturer --file ../manufacturers.txt;

It gives me an error:
Error: The command you entered does not appear to be valid or the program does not exist. If it is a script, please create it before setting up the cron job.

2
Contributors
2
Replies
23
Views
2 Years
Discussion Span
Last Post by london-G
1

You can remove /usr/bin. When not sure about the path of a command you can use env, e.g.:

/usr/bin/env php script.php --attribute hello --import ../world.txt

but not in case of cd, you don't need it.

In any case I'm not sure the above script will work, because the --file attribute is the equivalent of the -f flag, used by the PHP CLI SAPI to define a script or a file to execute, from man php:

--file file
-f file        Parse and execute file

I see that in your tutorial this is used to define a file to import in the script. If you see you cannot get it to work, then change the attribute to something else, like --import and then in the code just replace:

$this->getArg('file')

with:

$this->getArg('import')

then it should work fine.

Edited by cereal

0

Thanks Cereal,

That's sorted now!

Edited by london-G

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.