Howto create working cronjob?

  • Hi there,


    I have got a line what I should insert into cronjob..



    ....

    Code
    1. */15 * * * * php /var/www/virtual/tigyisolutions.hu/xxxx.php


    which cron file should be edited by me to get this work?


    Should I restart apache after edit cronjob file?

  • You can add a cronjob with "crontab -e" as root.
    But use for php the full path of the php library (test it with "which php")
    You can add a cronjob to the global crontab (/etc/crontab), too.
    There you are able to add an username which will start your Script.

  • Crontab is out of date and shouldn't be edited for own cronjobs.


    Better is to use:
    /etc/cron.d/


    Make a new file:
    vi /etc/cron.d/tigyisolutions.hu


    And add this:
    */15 * * * * vu20XX /usr/bin/php /var/www/virtual/tigyisolutions.hu/xxxx.php


    So the script will run under vu20XX.


    BTW: No need of restarting Apache2 or cron

    Edited once, last by fluser ().


  • Crontab is out of date and shouldn't be edited for own cronjobs.


    Where you read that???

    badge.php?id=1239063037&bid=2518&key=1747635596&format=png&z=547451206

  • Not working for me. I don't know. Maybe I do something wrong, but it don't work for me. I tried to search in google, but... No solution for me... :-s


    I have
    cron.d
    cron.daily
    cron.hourly
    cron.monthly
    cron.weekly


    folders is my etb... I tried to put in this to cron.d and cron.daily... Not work... :-(

  • badge.php?id=1239063037&bid=2518&key=1747635596&format=png&z=547451206


  • This is my crontab. Should it work?

  • Hey,


    when you use crontab -e this list has this Syntax:


    MINUTE HOUR DAY MONTH DAYOFWEEK COMMAND


    so you can't write the user in it, because every user has an own crontab list.
    if you run

    Code
    1. crontab -e


    you will run for the current user!


    if you run

    Code
    1. crontab -u v2000 -e


    you run it in this case for user v2000!


    All clear now?


    Kind regards


    Cosmo