#!/bin/sh export CAL_HOME=/opt/oracle/OraOcs10gHome/ocal/bin $CAL_HOME/uniuser -ls -format "%s%:%g%:%uid%:%id%:%node-id%:" -n 1 -p sysoppassword > users.txt str=$myline str=${str/\ /%} surname="" givenname="" uid="" startch=":" endch=":" echo sysoppassword awk -v str=$str -v st=$startch -v end=$endch 'BEGIN{ if (length(str)>0){ system("echo Processing line "str) s=index(str,startch) e=index(str,end) givenname=substr(str,s,e-1) surname=substr(str,e+1) uid=surname surname=substr(surname,0,index(surname,":")-1) uid=substr(uid,index(uid,":")+1) uid=substr(uid,0,index(uid,":")-1) #Replacing % in uid for unicpoutu tool, not replacing it in givenname because that is used in the export filename gsub("%"," ",uid) system("echo UID="uid) #When we have a givenname then start with export if (length(givenname) > 0) system("$CAL_HOME/unicpoutu -u \"UID="uid"\" -f exp-"surname"-"givenname".txt -n 1") } else system("echo ---------------------------------------") }' done <> |
Reference our earlier posts on exporting data from Oracle Calendar. For example, How to Extract Data from Oracle Calendar Server for a migration into Exchange or Zimbra.
In the script the value for CAL_HOME and sysoppassword have to be replaced before running.
To provide a password to unicpoutu change the config file "unison.ini" before exporting (can be found in $CAL_HOME\ocal\misc). The line allpasswordoption = TRUE should be added to the [UTL] section.
0 comments:
Post a Comment