Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to create a crontab to execute a php script, however I have to setup the cron via ssh and have absolutely no idea how to go about it. I've tried searching however the results always come back for executing ssh via a cron and not how to set one up.

Can someone point me in the right direction to some documentation?

Many thanks.

share|improve this question
What version of cron is it? Are you running a version of linux where you are able to simply publish a file to /etc/cron.d/? – Zoredache Nov 25 '10 at 19:13
up vote 3 down vote accepted

crontab -e is used to edit the cron entries for the current user. See the crontab(1) and crontab(5) man pages for more details.

share|improve this answer

Use ssh to gain access to the system you want to edit the crontab on. If required use su to change to an appropriate account

Then something like

export EDITOR=vi
crontab -e 

see the crontab(5) man page for info on the file itself and the crontab(1) man page for info on the crontab program

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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