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
* * * * * echo "Cron Worked $(date)" >> /tmp/cronworked.txt
ReplyDeletecat /tmp/cronworked.txt
ReplyDeleteit works:
ReplyDeletecrontab -e
* * * * * php ~/Desktop/Cron.php >> ~/cronlog.txt
:wq
~/Desktop/Cron.php
#!/usr/bin/env php
#!/usr/bin/env php
ReplyDelete<?php
echo "i am working from php ";
echo time();
?>