Sunday, 19 February 2012

How to install cron without shell editor

How to install cron without shell editor

Let’s say you don’t have an editor setup to work with crontab on a chroot server and you want to install a cron job.
What you have to do is the following:
$ contab -l
This will print currently installed cron jobs
$ crontab -l > cron.txt
Put contents of the crontab in a file. You can edit this file using and ftp/scp program or by other simple editor available on the server.
When you are ready install the cron…
$ crontab < cron.txt
If no errors are printed, cron job is installed successfully.


  1. * * * * * echo "Cron Worked $(date)" >> /tmp/cronworked.txt

  2. it works:

    crontab -e
    * * * * * php ~/Desktop/Cron.php >> ~/cronlog.txt



    #!/usr/bin/env php

  3. #!/usr/bin/env php

    echo "i am working from php ";

    echo time();