Cary Jamison wrote: >> Ok, I should have sent it too. There is probably a better way to do >> this, but here it is... >> >> #!/bin/bash >> >> # scp anything in the sync directory to the remote machine >> # and then move it to the done directory. >> # Currently only works with single files, not directories. >> >> RHOST=cjp >> RDIR="~/sync/recv" >> LDIR=~/sync >> LDONEDIR=~/sync/done >> LOGFILE=~/synclog >> TIMESTAMP=%D:%T >> DATE="date +$TIMESTAMP" >> >> echo $($DATE) sync.sh starting > $LOGFILE >> >> cd $LDIR >> while true >> do >> sleep 10
It appears to be crashing here in the sleep. It will go for just a few loops around to several minutes before crashing. What should I try next. Maybe a strace? >> for i in * .[^.]* >> do >> if [[ -f $i ]] >> then >> echo -ne $($DATE)\\040 >> $LOGFILE >> if scp -p -q $i $RHOST:$RDIR >> $LOGFILE 2>&1 >> then >> mv $i $LDONEDIR >> echo $($DATE) copied $i >> $LOGFILE >> fi >> fi >> done >> done Cary -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/