Question about Cron

I am trying to make the cron work on my linode.

Basically I installed a newletter software on my linode and it requires cron support.

The newsletter software giving me this command to run

> /usr/bin/php -f

/home/user/public/example.com/public_html/software-directory/cron.php

After searching on the library I found this http://library.linode.com/linux-tools/utilities/cron

but if I run > crontab -l on my ssh it says

> no crontab for username

Do I need to install/enable cron from somewhere? If yes what is the command?

Thanks

4 Replies

crontab -e will create a new crontab crontab -e -u username will create a new crontab for username man crontab will provide more help

@obs:

crontab -e

will create a new crontab crontab -e -u username will create a new crontab for username man crontab will provide more help

Hi obs,

Do I need to create a new cron tab then paste this command?

> /usr/bin/php -f

/home/user/public/example.com/public_html/software-directory/cron.php

Couple of questions

1. Is crontabs are domain specific? (I installed the newsletter software on subdomain)

2. Do I really need to create a new user to operate cron jobs?

Have another read of http://library.linode.com/linux-tools/utilities/cron it has some examples of how to schedule crons.

In your case you probably want it running under the www-data or apache2 user (whatever user php runs as) so you'd do crontab -e -u www-data

Then add 0 0 * * * /usr/bin/php -f /home/user/public/example.com/public_html/software-directory/cron.php
To run the command every day at midnight

I found this site to be very useful for less experienced folks to write crontabs: http://www.corntab.com/pages/crontab-gui

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct