Results 1 to 2 of 2

Thread: RedHat cron trouble

  1. #1

    RedHat cron trouble

    Hi All,
    Here is my workplace:
    /home/locatehomes/bainNew/test
    I need to delete a file named "f1" in my workplace every day at 14:15

    here is what I did (in the same workpalce):
    1) create a file "delfile"
    cat > delfile
    rm f1

    2)create a cron job "deljob"
    cat > deljob
    15 14 * * * /home/locatehomes/bainNew/test/delfile

    3) crontab deljob

    everything looks fine, but it dosen't work..


    while this works perfectly:
    15 14 * * * lynx -dump http://www.locatehomes.com/main/feedback/test.php

    Help Plz..

  2. #2
    you need to do

    Code:
    $ crontab -e
    And in the vi editor that pops up, you put the entry

    Code:
    15 14 * * * /home/locatehomes/bainNew/test/delfile
    You also have to make sure the permissions on the file are OK and that it is executable by your username.

    Finally the script itself should use full path names in it and the script also needs to define the shell it needs to use when running. In this case it is the /bin/bash shell, and the full path to the command is /bin/rm and /home/user/f1 for the file name.

    Code:
    #!/bin/bash
    /bin/rm -f /home/user/f1

Similar Threads

  1. Redhat 8.0 install trouble
    By bill_bob in forum Linux - Hardware, Networking & Security
    Replies: 3
    Last Post: 02-22-2003, 12:26 AM
  2. Trouble connecting to the internet using Redhat 8.0
    By FLY_FISHER in forum Linux - Hardware, Networking & Security
    Replies: 2
    Last Post: 10-24-2002, 11:46 AM
  3. Help with Cron
    By Baldy in forum Linux - Software, Applications & Programming
    Replies: 4
    Last Post: 05-23-2002, 01:51 PM
  4. gfx trouble with Redhat 7.2
    By doggiebone in forum Linux - Hardware, Networking & Security
    Replies: 9
    Last Post: 04-21-2002, 09:12 PM
  5. Trouble with ppp server on Redhat 7.1
    By rdly in forum Redhat / Fedora
    Replies: 4
    Last Post: 08-19-2001, 10:15 PM

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
  •