Unix Shell - crontab related

This is Interesting: Free IT Magazines  
Home > Archive > Unix Shell > January 2006 > crontab related





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author crontab related
sheller

2006-01-02, 7:50 am

Hi all

The following mail works in command line.

mail myname@hotmail.com < i.file

But the following line put in a file "test"

20 5 * * * mail myname@hotmail.com < i.file

doesn't work with

crontab test

Can any one explain please? I use Redhat Linux 8.

Thanks.

-arasu





Randolf Balasus

2006-01-02, 7:50 am

sheller wrote:
> Hi all
>
> The following mail works in command line.
>
> mail myname@hotmail.com < i.file
>
> But the following line put in a file "test"
>
> 20 5 * * * mail myname@hotmail.com < i.file
>
> doesn't work with
>
> crontab test
>
> Can any one explain please? I use Redhat Linux 8.
>
> Thanks.
>
> -arasu

it seems you need the absolute path to the files ? where is "i.file"
located ?

Greetings Randolf Balasus
base60

2006-01-02, 5:58 pm

sheller wrote:
> Hi all
>
> The following mail works in command line.
>
> mail myname@hotmail.com < i.file
>
> But the following line put in a file "test"
>
> 20 5 * * * mail myname@hotmail.com < i.file
>
> doesn't work with
>
> crontab test
>
> Can any one explain please? I use Redhat Linux 8.


"mail" is found via the PATH environment variable set at login.

You should be using an absolute path.
sheller

2006-01-02, 8:50 pm

Greetins. the i.file is in where I give the
crontab command. i.e. myhome/share. Is it still
wrong? Thanks

-arasu


>sheller wrote:
>it seems you need the absolute path to the files ? where is "i.file"
>located ?
>
>Greetings Randolf Balasus
>
>



Chris F.A. Johnson

2006-01-03, 2:50 am

On 2006-01-03, sheller wrote:

[please don't top post]
[vbcol=seagreen]
> Greetins. the i.file is in where I give the
> crontab command. i.e. myhome/share. Is it still
> wrong?


The crontab only intalls the cron command that you give it; it
doesn't change where cron runs the command. Put the full path to
the file in the command itself.

--
Chris F.A. Johnson, author | <http://cfaj.freeshell.org>
Shell Scripting Recipes: | My code in this post, if any,
A Problem-Solution Approach | is released under the
2005, Apress | GNU General Public Licence
sheller

2006-01-03, 7:50 am

Thanks again. It works when I give the full path in
the machine at my university. The same not working
in my personal linux after giving the full path. Not sure
what's to be done. Thanks.

-arasu

>On 2006-01-03, sheller wrote:
>
>[please don't top post]
>
>
> The crontab only intalls the cron command that you give it; it
> doesn't change where cron runs the command. Put the full path to
> the file in the command itself.
>
>--
> Chris F.A. Johnson, author | <<a href="http://cfaj.freeshell.org">http://cfaj.freeshell.org</a>>
> Shell Scripting Recipes: | My code in this post, if any,
> A Problem-Solution Approach | is released under the
> 2005, Apress | GNU General Public Licence
>
>



Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com