Results 1 to 6 of 6

Thread: Problem in using cron command

  1. #1
    Join Date
    Dec 2009
    Posts
    296

    Problem in using cron command

    Hello,
    I wanted to create a stats-page file in / etc / cron.daily but during the execution of it I received the following email:
    Code:
     Topic: <root@jenyfer> Cron test-x / usr / sbin / anacron | | run-parts - report / etc / cron.daily
    message: / etc / cron.daily / stats-site:
    run-parts: failed to exec / etc / cron.daily / stats-site: Exec format error
    run-parts: / etc / cron.daily / stats-site exited with return code 1
    my file contains the following line:
    Code:
     0 0 * * * / usr / lib / cgi-bin / awstats.pl-config = test.tux-atome
    So I Pause following questions:
    1.) Do I make my executable file-stats site? or of the 'exec format error' I suppose?
    2.) Do I put my files elsewhere so that it is taken into account automatically?
    If I put it in / etc / cron.d / he is not executed (no return emails)
    Any help on this topic will be highly appreciated. Thanks in advance.

  2. #2
    Join Date
    Nov 2009
    Posts
    343

    Re: Problem in using cron command

    Hello,
    either you put this line:
    Code:
     0 0 * * * / usr / lib / cgi-bin / awstats.pl-config = test.tux-atome
    in / etc / crontab
    Or either you create a file-stats site / etc / cron.daily where you put:
    Code:
    / usr / lib / cgi-bin / awstats.pl-config = test.tux-atome
    And
    Code:
    chmod + x / etc / cron.daily / stats-site
    Hope the above information will help you.

  3. #3
    Join Date
    Nov 2009
    Posts
    583

    Re: Problem in using cron command

    Hello,
    cron.daily, as the name indicates, is a directory containing scripts launched 1 time per day (there cron.mouthly, cron.hourly, cron.weekly) These scripts must be executable course, these are scripts thus 0 0 **** in front of the line can not run. Otherwise it you must add this to crontab "standard" via crontab-e or crontab-e in your case I think (see man crontab).

  4. #4
    Join Date
    Dec 2009
    Posts
    292

    Re: Problem in using cron command

    Hello,
    I have a similar problem and I want to know about it. I think rather see put to direct
    Code:
    / usr / lib / cgi-bin / awstats.pl-config = test.tux-atome
    in my cron.daily.
    I prefer to avoid using
    Code:
    crontab-l
    then
    Code:
    crontab <myfile
    because I would have to use exec () in php and avoid amassing, if you know what time the scripts in / etc / cron.daily run?

  5. #5
    Join Date
    Nov 2009
    Posts
    356

    Re: Problem in using cron command

    Hello,
    if you know what time the scripts in / etc / cron.daily run?
    Try
    Code:
    cat / etc / crontab
    and you have the answer.
    I have it on my machine:
    Code:
    25 8 * * * root test-x / usr / sbin / anacron | | run-parts - report / etc / cron.daily
    So every day at 8:25. This is going to help you, just have a try at it.

  6. #6
    Join Date
    Nov 2009
    Posts
    446

    Re: Problem in using cron command

    Hello,
    I do not think there are problems in using the cron command in linux , it works very well. Crontab allows you to schedule regular tasks on your computer. You can for example decide to schedule a backup every your specified months, or perform administrative tasks such as launching system tasks (checking mail, extinctions of network stations, etc). So, I recommend you to read on cron command and then implement the command what ever you what to schedule, you can do it later.

Similar Threads

  1. Combining SSH and Cron
    By void in forum Software Development
    Replies: 3
    Last Post: 06-08-2010, 01:44 AM
  2. How to setup Cron Job via ssh
    By Nalini_sh in forum Operating Systems
    Replies: 3
    Last Post: 12-11-2009, 10:16 AM
  3. Running PHP Scripts with Cron
    By klite in forum Software Development
    Replies: 5
    Last Post: 04-11-2009, 08:26 AM
  4. Replies: 3
    Last Post: 03-09-2009, 05:41 PM
  5. Cron no output !!
    By Jabeen in forum Software Development
    Replies: 3
    Last Post: 13-07-2009, 09:05 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,727,128,548.29403 seconds with 17 queries