# Periodic no backup



## fuhdan (Jul 12, 2010)

Hi
I wrote a script to backup my Database. So I put the file in the folder

```
/etc/periodic/daily/
```


```
-rwxr-xr-x  1 root  wheel  1359 Jul  9 08:13 220.backup-mysql
```

In my log I get the following:

```
Start Backup: Mon Jul 12 03:01:15 CEST 2010
MySQL-Datenbanken werden gesichert - Anzahl: 0
MySQL-Backup: 0/0 erfolgreich
MySQL-Backup wird komprimiert
MySQL-Backup: Raeume Backup(s) auf
MySQL-Backup abgeschlossen
################################################
```

If I run the script by hand, I get the following output:

```
Start Backup: Mon Jul 12 13:56:54 CEST 2010
MySQL-Datenbanken werden gesichert - Anzahl: 4
MySQL-Backup: 4/4 erfolgreich
MySQL-Backup wird komprimiert
MySQL-Backup: Raeume Backup(s) auf
MySQL-Backup abgeschlossen
################################################
```

What do I have to do, that the backup works in the daily backup?
`
Thanks

Daniel


----------



## DutchDaemon (Jul 12, 2010)

Try using full path names to each and every command in the script.


----------



## fronclynne (Jul 12, 2010)

As DutchDaemon sagt: periodic may require full pathnames for everything outside of /bin/ /sbin/ /usr/bin/ & /usr/sbin/.

It might behave like crontab(1) (crontab(5)), to wit: 
	
	



```
# /etc/crontab - root's crontab for FreeBSD
#
# $FreeBSD: src/etc/crontab,v 1.33.2.1.4.1 2010/06/14 02:09:06 kensmith Exp $
#
SHELL=/bin/sh
PATH=/etc:/bin:/sbin:/usr/bin:/usr/sbin
```

Or it may be worse and pass no $PATH to the shell at all, I don't know.


----------



## dennylin93 (Jul 13, 2010)

Or put something like this in your script:

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


----------



## fuhdan (Jul 14, 2010)

I put the line following line in:

```
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin
```
and it works perfect.

Thanks for your help


----------

