Hi friends,
i am Swanand. I am just trying to know linux now. I am faced with a problem. I am trying to schedule a program using cron. But i am not able to schedule it.
I was logged in as user root. Then i made a file in the directory
/etc/cron.d named myfile, and wrote the following things :
--------------------------------------------------------
SHELL=/bin/bash
#PATH=/root:/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root
HOME=/
01 * * * * root echo "yahoo!"
--------------------------------------------------------
But i received a mail and when i checked it, it showed :
From
root@localhost.localdomain Sat Jan 28 20:01:05 2006
Return-Path: <root@localhost.localdomain>
Received: from localhost.localdomain (localhost.localdomain [127.0.0.1])
by localhost.localdomain (8.13.1/8.13.1) with ESMTP id k0SEV37t004890
for <root@localhost.localdomain>; Sat, 28 Jan 2006 20:01:04 +0530
Received: (from root@localhost)
by localhost.localdomain (8.13.1/8.13.1/Submit) id k0SEV2Lb004888;
Sat, 28 Jan 2006 20:01:03 +0530
Date: Sat, 28 Jan 2006 20:01:03 +0530
Message-Id: <200601281431.k0SEV2Lb004888@localhost.localdomain>
From:
root@localhost.localdomain (Cron Daemon)
To:
root@localhost.localdomain
Subject: Cron <root@localhost> root rm /root/testcron.txt
X-Cron-Env: <SHELL=/bin/bash>
X-Cron-Env: <PATH=/root:/sbin:/bin:/usr/sbin:/usr/bin>
X-Cron-Env: <MAILTO=root>
X-Cron-Env: <HOME=/>
X-Cron-Env: <LOGNAME=root>
X-Cron-Env: <USER=root>
/bin/bash: root: command not found
-----------------------------------------------------
Can anyone please tell me how to schedule the jobs using cron ????
Thank you.