[svlug] bash scripts and cron
johnmc at johnmc.org
Fri Jan 10 12:33:02 PST 2003
I have a problem that's been bugging me and I'm wondering if anyone can
shed some light on it. I have a set of backup scripts that run perfectly
from the command line but fail when called from cron.
It's a simple tar and scp script and it looks fine to me. This is on 5
different Cobalt Raqs. What happens is that tar runs fine, but the scp
Anyone able to point out the obvious? I've made sure the keypairs are
here's the script (with the names modified to protect the innocent, it
should still be obvious enough):
tar czfp /tmp/$host-home.tar.gz --exclude='*/stats/*' \
scp -u -P $port /tmp/$host-home.tar.gz cobalt@$dest:$host
tar czfp /tmp/$host-site1.tar.gz --exclude=\'*/stats/*\' \
scp -u -P $port /tmp/$host-site1.tar.gz cobalt@$dest:$host;
for i in `seq 2 19`; do
tar czfp /tmp/$host-site$i.tar.gz --exclude=\'*/stats/*\' \
scp -u -P $port /tmp/$host-site$i.tar.gz cobalt@$dest:$host;
date +"%Y-%m-%d" > ~johnmc/last_full
. johnmc@ | bucketchild.net - +1-408-985-7992 (home) .
. http:// | johnmc.org - +1-408-386-3549 (cell) .
More information about the svlug