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.

http://www.geeksonwork.com/how-to-install-cron-without-shell-editor.html

4 comments:

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

    ReplyDelete
  2. it works:

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

    :wq

    ~/Desktop/Cron.php

    #!/usr/bin/env php

    ReplyDelete
  3. #!/usr/bin/env php
    <?php


    echo "i am working from php ";

    echo time();
    ?>

    ReplyDelete