# Dirvish crontab problem



## Abstract (Jan 21, 2011)

Hi Everyone,

I'm not sure if this is posted in the right forum. I've installed dirvish on my FreeBSD 8.1 server. I did install and configure it. I made some test runs and it all worked. It makes connection with rsync to an other server. I setup ssh keys so no password or passphrase is required. 

I want to setup a crontab to do daily backups. I created a file called:
/usr/local/sbin/dirvish-crontab-runall.sh

In that file are the commands:

```
/usr/local/sbin/dirvish-expire --quiet;
/usr/local/sbin/dirvish-runall --quiet;
```

My crontab command:

```
34 16 * * * sh /usr/local/sbin/dirvish-crontab-runall.sh
```

I executed the command [cmd=]sh /usr/local/sbin/dirvish-crontab-runall.sh[/cmd] by hand to make sure it worked. The crontab is installed under the root user and I executed the command logged in as root. The execution of the command went perfect.  

Looking at my crontab log it says this:

```
Jan 21 16:34:00 LocalServer /usr/sbin/cron[66657]: (root) CMD (sh /usr/local/sbin/dirvish-crontab-runall.sh)
```

To my surprise nothing happened at all. Does anyone know what could be the problem?

Thanks


----------



## DutchDaemon (Jan 21, 2011)

Sure, and it's been brought up dozens of times already: cron has a very limited path, which does not include anything under /usr/local. Either use full path names to every command in your scripts when they're supposed to be run from cron, or put an additional/expanded PATH= entry as the first line in the crontab, usually something like:


```
PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/games:/usr/local/sbin:/usr/local/bin
```


----------



## Abstract (Jan 21, 2011)

That did the trick! Thanks for letting helping me out


----------

