1

This may sound like a dumb question but I really don't understand it. For example, Magento 2 has been saying to make sure "Magento cron job is running".

Create the cron job
To create a cron job as the Magento file system owner, enter the following command as a user with root privileges:
crontab -u <Magento file system owner user name> -e
Then write in the file:
"path-to-binary" -c "ini-file-path" "your Magento install dir"/bin/magento cron:run [>> "log-file"&]
"path-to-binary" -c "ini-file-path" "your Magento install dir"/update/cron.php [>> <log-file>&]
<path-to-binary> -c "ini-file-path" "your Magento install dir"/bin/magento setup:cron:run [>> "log-file"&]*

As I said before, this was an example because my problem is that I do not know where to write those commands. It always says to write this command or write the other, but I can't find where I am supposed to put them.

UPDATE:
I have access to cPanel to manage my server and use FTP to upload the files.

  • Did you install Magento2 on a local machine or a server? Did you install it on Windows, Mac or Linux? – 7ochem Apr 13 '16 at 18:13
  • Magento 2 on server and I have a Windows laptop. – Mirimari Apr 14 '16 at 2:49
  • How are you connecting to your server? What connection possibilities do you have? FTP? SFTP? SSH? or maybe only via some admin panel (cPanel, DirectAdmin, Plesk)? – 7ochem Apr 14 '16 at 12:20
  • 1
    I have access with the cPanel and FTP, but mainly for files I use FTP. – Mirimari Apr 15 '16 at 3:35
  • 1
    Hi @Mirimari, were you able to solve this issue? If so, how? – 7ochem Aug 26 '16 at 14:02
3

There is no place to "put" the crontab. You run the crontab command as root and cron starts running. You don't have to change to a directory but you do have to create cron as the correct user.

More info about cron

  • But how would I run the "crontab command as root"? Does this mean I write those commands in the file cron.php? – Mirimari Apr 14 '16 at 2:52
  • The answer to this question is, you log in as or elevate to root using sudo and enter the command. If you do not have root access, see the other answers. – Steve Johnson Apr 15 '16 at 13:32
2

On a server you would enter those in the crontab command line tool via crontab -e but since you're using Windows please read this answer. It describes how you create a task in Windows Task Scheduler.

Optionally to test the cron you can also call cron.php from your browser

1

The Magento2 documentation is describing how to set up cronjobs on a Linux machine when you have access to a terminal and can type these commands on a command line.

In your case, this is not possible. You have to set the cronjobs via your cPanel. I'm sure cPanel provides manuals/tutorials for that (I Googled and found this).

See also this question concerning cPanel and cronjob.

There's some placeholders in the part of the documentation that you have quoted and the documentation explains what you need to put there. Of course you cannot enter the commands written there to find your PHP binary or your php.ini, so you need to Google some more to find out where they are on your server.

  • I don't understand the down vote as it is exactly the right answer to the OP's question who is using cPanel to manage his website/webserver. – 7ochem Jun 3 '16 at 5:35
  • some things will never undrestand to anyone :) – Baby in Magento Dec 1 '16 at 6:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.