DSM-G600, DNS-3xx and NSA-220 Hack Forum

Unfortunately no one can be told what fun_plug is - you have to see it for yourself.

You are not logged in.

Announcement

#1 2008-10-16 01:42:01

Loose Gravel
Member
Registered: 2008-10-14
Posts: 50

| wc in cronjob script not working?

I have a weird problem:

I created a script /ffp/bin/testcase.sh

Code:

#!/bin/sh
echo Testcase starts > /ffp/log/testcase.log
ls -1 /ffp/bin | wc  >> /ffp/log/testcase.log
echo Testcase ends >> /ffp/log/testcase.log

When I run the script, I get this result, as expected:

Code:

Testcase starts
      276       276      1860
Testcase ends

If I run the same script a a cronjob, I get

Code:

Testcase starts
Testcase ends

I looks like the | wc is not working in cronjobs ?.?.?

Am I missing something?

Gravel
FW 1.05 / ffp5


EDIT: Found the solution by adding export PATH=/ffp/sbin:/ffp/bin:$PATH to my script.

Fonz: If everyone expect me is aware of this, its ok. Otherwise I recommend  some faq for cronjobs added to the ffp wiki

Last edited by Loose Gravel (2008-10-16 02:10:17)

Offline

 

#2 2008-10-18 02:24:30

rcblackwell
Member
From: Pickering, ON
Registered: 2008-05-19
Posts: 204
Website

Re: | wc in cronjob script not working?

Loose Gravel wrote:

I looks like the | wc is not working in cronjobs ?.?.

I couldn't tell you how to fix this problem however I did find a couple of articles that explain the situation and might help

http://www.unix.com/answers-frequently- … ontab.html and http://www.unix.com/unix-advanced-exper … -cron.html

Last edited by rcblackwell (2008-10-18 02:25:05)


Bob Blackwell
Pickering, ON

Offline

 

#3 2008-10-18 13:08:11

fonz
Member / Developer
From: Berlin
Registered: 2007-02-06
Posts: 1716
Website

Re: | wc in cronjob script not working?

Loose Gravel wrote:

Fonz: If everyone expect me is aware of this, its ok. Otherwise I recommend  some faq for cronjobs added to the ffp wiki

Go ahead. I'm all for it.

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2010 PunBB