Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I've searched everywhere, but can't seem to find the answer. I'm trying to run this through Linux Debian SSH terminal

0 */5 * * * /var/www/test/cron.php

And of course there should be some keyword at first to make it run: for example

cron 0 */5 * * * /var/www/test/cron.php

But it doesn't work. What should I do ?

share|improve this question
    
The way to install a cron entry is to edit the user's crontab. ssh remote crontab -e will bring up an editor. If you are unfamiliar with Unix editors, or prefer noninteractive operation, try ssh remote '(crontab -l; echo "0 */5 * * * /var/www/test/cron.php" ) | crontab -' –  tripleee Aug 5 '12 at 16:36
add comment

migrated from stackoverflow.com Aug 6 '12 at 1:44

This question came from our site for professional and enthusiast programmers.

1 Answer

Cron runs on a described schedule, you have the schedule set to 0 */5 * * * which is "every 5 hours". You can either wait for the 5th, 10th, 15th, or 20th hour for cron to run that command, or just execute the command /var/www/test/cron.php from the command line.

$ /var/www/test/cron.php

Alternatively, you could change the schedule so that it executes (almost) immediately by changing it in the crontab to:

* * * * * /var/www/test/cron.php

Then changing it back after it runs.

share|improve this answer
add comment

Your Answer

 
discard

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.