Cron Job tar gzip

Hello,

why does this script only creates a 1 kb file? executing the same line directly on the shell works well.

#!/bin/sh

tar c /rente/DATEIEN /rente/FORMS |gzip > /rente2/RD-Date.tar

Greets

These problems are posted here in the forum quite often.

A guess is that it doesn't find tar or gzip while running as cronjob. Try using absolute paths. Running something via cron has not the same environment like the user has, when you run it interactively. You have to add/source your environment like for example .profile, .bashrc, and so on, whatever you need.

Here is a detailed explanation about the most common problems and how cronjobs work:
cron and crontab

Hoi,

thanks for the fast answer.

.....|/usr/contrib/bin/gzip > ......

did the job for me.

Thanks zaxxon

greets from Germany...