If you don't redirect the output in your cronfile to /dev/null, the cron daemon normally should have sent a mail to the user that's running this cronjob. (presumably root) The mail should mention what's wrong. (Also, you might want to start your script with "!/bin/bash". It is not necessary for crontab as it is its default to use /bin/sh (which is bash on linux) but it's good practice)
From Linux - User to suse-linux-e@suse.com about [SLE] Problems running a...:
Hi !!
I'm making the backup of my linux users via Crontab... I make a Script that make the backup for each one of the users.
If I run manually the backup from the shell it run ok, but if it run's from the Crontab, it doesn't make the backup.
thanks
bye
--ed
This is the script content
# Get the aliases and functions if [ -f ~/.bashrc ]; then . ~/.bashrc fi
# User specific environment and startup programs
PATH=$PATH:$HOME/bin ENV=$HOME/.bashrc USERNAME="root"
export USERNAME ENV PATH
for j in `ls /var/mnt/System/User | grep -v backup.exe | grep -v backup | grep -v evega | grep -v backup` do RESP_TOC=/var/mnt/System/User/backup/"$j"_`date '+%d%m%Y_%H%C'`.toc RESP_TAR=/var/mnt/System/User/backup/"$j"_`date '+%d%m%Y_%H%C'`.tar echo `date` > $RESP_TOC echo "Backing up "$j >> $RESP_TOC echo "/p" >> $RESP_TOC ls -lah -R /var/mnt/System/User/$j >> $RESP_TOC tar cf $RESP_TAR $j done
-- dieter