Results 1 to 4 of 4

Thread: Error Cron

  1. #1
    Join Date
    Dec 2007
    Posts
    35

    Error Cron

    # crontab -e
    0 22 * * * /var/backup/backup.sh

    From [email protected] Thu Sep 4 21:00:01 2008
    Return-Path: <[email protected]>
    Received: from xxx.com (xxx.com [127.0.0.1])
    by xxx.com (8.13.8/8.13.8) with ESMTP id m85101wj001028
    for <[email protected]>; Thu, 4 Sep 2008 21:00:01 -0400
    Received: (from [email protected])
    by xxx.com (8.13.8/8.13.8/Submit) id m85101An001027;
    Thu, 4 Sep 2008 21:00:01 -0400
    Date: Thu, 4 Sep 2008 21:00:01 -0400
    Message-Id: <[email protected]>
    From: [email protected] (Cron Daemon)
    To: [email protected]
    Subject: Cron <[email protected]> /var/backup/backup.sh
    Content-Type: text/plain; charset=UTF-8
    Auto-Submitted: auto-generated
    X-Cron-Env: <SHELL=/bin/sh>
    X-Cron-Env: <HOME=/root>
    X-Cron-Env: <PATH=/usr/bin:/bin>
    X-Cron-Env: <LOGNAME=root>
    X-Cron-Env: <USER=root>

    /bin/sh: /var/backup/backup.sh
    : No such file or directory


    How to solve this?
    Thanks

  2. #2
    Join Date
    Jan 2008
    Location
    United Kingdom
    Posts
    414
    Does '/var/backup/backup.sh' Exist?

  3. #3
    Join Date
    Dec 2007
    Posts
    35
    Yes.

    [[email protected] /]# cd var
    [[email protected] var]# cd backup
    [[email protected] backup]#

    Using ./backup.sh not the error.

  4. #4
    Join Date
    May 2007
    Location
    Chicago
    Posts
    322
    Sometimes the environment variables (in particular path) that are used for cron jobs are different than normal logins - check backup.sh to see if it's calling any commands without a full path. If so, try either updating your cron file to include the correct paths, or adding explicit paths in the script.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •