# cron email freebsd-update: not found



## srivo (Dec 28, 2011)

This is a very simple question! I put that command in crontab -e:

```
@daily freebsd-update cron
```
and here is the email I received each morning

```
freebsd-update: not found
```


----------



## SirDice (Dec 28, 2011)

Cron has a very limited *$PATH*. Use the full path to the binary.


----------



## srivo (Dec 28, 2011)

I suggest that section 25.2.2 of the handbook be modified to reflect the correct way of using freebsd-update cron with crontab -e.


----------



## SirDice (Dec 28, 2011)

I suggest sending a PR with the changes.

http://www.freebsd.org/send-pr.html


----------



## setevoy (Oct 19, 2012)

srivo said:
			
		

> I suggest that section 25.2.2 of the handbook be modified to reflect the correct way of using freebsd-update cron with crontab -e.



Well, now still the same:


```
cron         Sleep a random amount of time between 1 and 3600 seconds,
                  then download updates as if the fetch command was used.  If
                  updates are downloaded, an email will be sent (to root or a
                  different address if specified via the -t option or in the
                  configuration file).  As the name suggests, this command is
                  designed for running from cron(8); the random delay serves
                  to minimize the probability that a large number of machines
                  will simultaneously attempt to fetch updates.
```

Thanks to all.


----------



## SirDice (Oct 19, 2012)

setevoy said:
			
		

> Well, now still the same:


Man pages aren't the handbook.

http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/


----------



## setevoy (Oct 19, 2012)

SirDice said:
			
		

> Cron has a very limited *$PATH*. Use the full path to the binary.



But what is in it:


```
SHELL=/bin/sh
PATH=/etc:/bin:/sbin:/usr/bin:/usr/sbin
```
And freebsd-update are in:


```
/usr/sbin/freebsd-update
```

So, why are mistake here?

```
freebsd-update: not found
```


----------



## setevoy (Oct 19, 2012)

SirDice said:
			
		

> Man pages aren't the handbook.
> 
> http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/




Yes, but here is from Handbook:


```
An entry in /etc/crontab would be sufficient to accomplish this task:

@daily                                  root    freebsd-update cron
```


----------



## SirDice (Oct 19, 2012)

If nobody files a PR it's not going to change all by itself.


----------



## chatwizrd (Oct 19, 2012)

Why don't you just use the full path and be done with it?


----------



## wblock@ (Oct 19, 2012)

setevoy said:
			
		

> Yes, but here is from Handbook:
> 
> 
> ```
> ...



That is different from crontab -e.  Note the path settings in /etc/crontab.


----------

