Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
 Post subject: Question about Cron
PostPosted: Thu Sep 27, 2012 9:25 am 
Offline
Junior Member
User avatar

Joined: Mon Sep 17, 2012 4:33 am
Posts: 43
Website: http://www.bonsoni.com
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

Quote:
/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
Quote:
crontab -l
on my ssh it says

Quote:
no crontab for username


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

Thanks

_________________
Ubuntu 10.4 LTS, Apache2, LAMP, n00b

Online Shopping


Top
   
 Post subject: Re: Question about Cron
PostPosted: Thu Sep 27, 2012 10:11 am 
Offline
Senior Member

Joined: Sun Mar 07, 2010 7:47 pm
Posts: 1970
Website: http://www.rwky.net
Location: Earth
Code:
crontab -e
will create a new crontab
Code:
crontab -e -u username
will create a new crontab for username
Code:
man crontab
will provide more help

_________________
Paid support
How to ask for help
1. Give details of your problem
2. Post any errors
3. Post relevant logs.
4. Don't hide details i.e. your domain, it just makes things harder
5. Be polite or you'll be eaten by a grue


Top
   
 Post subject: Re: Question about Cron
PostPosted: Thu Sep 27, 2012 10:33 am 
Offline
Junior Member
User avatar

Joined: Mon Sep 17, 2012 4:33 am
Posts: 43
Website: http://www.bonsoni.com
obs wrote:
Code:
crontab -e
will create a new crontab
Code:
crontab -e -u username
will create a new crontab for username
Code:
man crontab
will provide more help


Hi obs,

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

Quote:
/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?

_________________
Ubuntu 10.4 LTS, Apache2, LAMP, n00b

Online Shopping


Top
   
 Post subject: Re: Question about Cron
PostPosted: Thu Sep 27, 2012 1:13 pm 
Offline
Senior Member

Joined: Sun Mar 07, 2010 7:47 pm
Posts: 1970
Website: http://www.rwky.net
Location: Earth
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
Code:
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

_________________
Paid support
How to ask for help
1. Give details of your problem
2. Post any errors
3. Post relevant logs.
4. Don't hide details i.e. your domain, it just makes things harder
5. Be polite or you'll be eaten by a grue


Top
   
 Post subject: Re: Question about Cron
PostPosted: Sat Sep 29, 2012 11:25 am 
Offline
Senior Member

Joined: Wed Jun 27, 2012 10:00 pm
Posts: 87
Website: http://hemonc.org/wiki/Main_Page
I found this site to be very useful for less experienced folks to write crontabs: http://www.corntab.com/pages/crontab-gui

_________________
Amateur, eager to learn.
My hematology, oncology, and chemotherapy regimen wiki


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group