Unix administration - crontab related

This is Interesting: Free IT Magazines  
Home > Archive > Unix administration > 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-07, 8:49 pm

My crontab command in RedHat 8 is

*/1 * * * * /home/arasuk/share_file/searcha

The above command works fine with the following
simple script put in "searcha" (executable)

#!/bin/sh
ls

.. But not with the following

#!/bin/sh
cp r.file r.out

This latter script work in command line. I give absolute path
to the command. Any clue for the latter to work?

Thanks.

-arasu


JohnK

2006-01-08, 5:57 pm

sheller wrote:
>
> #!/bin/sh
> cp r.file r.out


Are you making an assumption about the working directory?

Try

cp /path/to/file/r.file /path/to/file/r.out

JohnK
Barry Margolin

2006-01-08, 5:57 pm

In article <dppmco$eea$1@bunyip2.cc.uq.edu.au>,
"sheller" <arasu@uq.edu.au> wrote:

> My crontab command in RedHat 8 is
>
> */1 * * * * /home/arasuk/share_file/searcha
>
> The above command works fine with the following
> simple script put in "searcha" (executable)
>
> #!/bin/sh
> ls
>
> . But not with the following
>
> #!/bin/sh
> cp r.file r.out


What error does it get?

>
> This latter script work in command line. I give absolute path
> to the command. Any clue for the latter to work?


If it complains "file not found", it's probably because cron isn't
running the script in the directory you expect.

--
Barry Margolin, barmar@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***
*** PLEASE don't copy me on replies, I'll read them in the group ***
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com