I built the following shell script to bring up a pptp tunnel, grab a
file via rsync, change some perms, and bring the tunnel down. When I run
it directly logged in as root, I don't get problems.

/usr/sbin/pon det-cle && \
sleep 3

ppp0_address=$(/sbin/ifconfig ppp0 | grep addr | awk '{print $2}' | sed
-e 's/addr://')

/sbin/route add -net [deleted].0 netmask 255.255.255.0 gw $ppp0_address

/usr/bin/rsync -avzD --progress --stats --password-file
~/[deleted] [EMAIL PROTECTED]::[deleted-path]

chown [deleted-user]:[deleted-group] ~[deleted-user]/[deleted-file]
chmod 600 ~[deleted-user]/[deleted-file]
chmod 700 ~[deleted-user]

/sbin/route del -net [deleted].0 netmask 255.255.255.0
/usr/sbin/poff det-cle


However, when I run it from cron as the same shell script (and redirect STDERR 
and STDOUT to files):

ppp0: error fetching interface information: Device not found


Which means I get errors throughout the rest of the script.

What I don't understand is why this runs fine when I run it directly but not 
when I run it as a cron job.

-- 
gentoo-user@gentoo.org mailing list

Reply via email to