This is my simple script
#!/usr/bin/ksh
 
#Ghassan Jumblat
set -x

typeset loc_dir[0]=/etc
typeset dir[0]=admin

resultfile=/tmp/sync_result 
logfile="/tmp/sync_Retail.$$"
exclude_file=/tmp/exclude.txt 
dest_mach="s2004can"
mail_to="[EMAIL PROTECTED]" 

trap 'rm -rf $logfile; trap 0; exit' 0 1 2 15

> $resultfile
for i in 0; 
do print "---------------------" >> $resultfile 
print "INFO `date` synchronizing loc_dir ${loc_dir[$i]}; dir ${dir[$i]}"
>>$resultfile 

cd ${loc_dir[$i]}

/usr/sbin/rsync -arvzptgo --delete --exclude *core --exclude *.tar --exclude
*.err --exclude-from $exclude_file ${
dir[$i]} ${dest_mach}:${loc_dir[$i]} 2>&1 $logfile

cat $logfile >> $resultfile
 
done 
#cat $resultfile | /usr/bin/mailx -s "Sync Completed"  $mail_to

exit

However when I ran I got the following
building file list ... link_stat s2004can:/etc : No such file or directory
done
created directory /tmp/sync_Retail.1229
IO error encountered - skipping file deletion

I am not sure how to fix the problem
Note: The machine can rlogin/rsh to the destination machine.

regards,
ghassan
System Engineer
w: 416-682-6428
f: 416-682-6409
c: 416-985-8300

Warning:  All e-mail sent to or from this address will be received by the
Charles Schwab corporate e-mail system and is subject to archival and review
by someone other than the recipient.


Reply via email to