Hi Matt and everyone else,
I've tested the script below by removing a cancelled appointment in my iPhone Calendar and running the script. At the end the appointment had been removed from my Macbook Calendar so it seems to work OK but I'm not a programmer so use it at your own discretion and also it's not very pretty.
Copy and paste the script into Text Editor. Replace 'username' with your own login name and save the file as plain text. I called it SyncCal.txt.
In a terminal window change to the directory where you saved it and type chmod u+rwx SyncCal.txt. This makes it executable.
To run it, still in the terminal window, type ./SyncCal.txt and follow the prompts.
I had the Macbook Calendar open and watched for the cancelled appointment disappearing before answering the prompt 'Wait for sync to complete then press Y' just to be sure it had completed.
Remember it still puts a copy in the cloud but hopefully that copy is removed by Apple when you turn off iCloud sync. (Even though Apple seem to do this who knows what Microsoft and Amazon do with the data if it's true that Apple store it on their servers?)
I think in the end I may go for the OSX Server solution so that I can also sync my contacts, I can't put them in the cloud.
Good luck, hope you find it useful.
Chris.
__________________________________________________________
#Sync Procedure
echo ENSURE YOU HAVE AN UP_TO_DATE BACKUP!
echo
echo /Users/username/Library/Calendars.bak, if it exists, will be overwritten by this procedure, rename it if you want to keep it!
echo
echo /Users/username/Library/Calendars will be copied to /Users/username/Library/Calendars.bak.
echo
echo /Users/username/Library/Calendars will then be overwritten by your new synchronised Calendar.
#Change to correct directory
cd /Users/username/library
if [ "$?" = "0" ]; then
pwd
else
echo Cannot change directory!
exit 1
fi
#Copy “Calendars” directory to ../Calendars.bak
cp -Rf ./Calendars ./Calendars.bak
if [ "$?" = "0" ]; then
echo Calendar backup completed.
else
echo Cannot Backup Calendar!
exit 1
fi
#Prompt to turn on sync on iPhone and await confirmation
echo -n Turn on Calendar sync on your iPhone and press Y when done or any other key to quit
read input
case $input in
#Check for Y
Y ) echo You confirmed your iPhone is ready to sync;;
# Check for anything else
* ) echo You did not type a Y.
echo Ensure you have turned OFF Calendar sync on your iPhone, select RETAIN DATA LOCALLY.
echo Quitting.
exit 1;;
esac
#Prompt to turn on sync on Mac and await confirmation
echo -n Turn on Calendar sync on your Mac and press Y when done or any other key to quit
read input
case $input in
# Check for Y
Y ) echo You confirmed your Mac is ready to sync;;
# Check for anything else
* ) echo You did not type a Y.
echo Ensure you have turned OFF Calendar sync on your Mac.
echo Quitting.
exit 1;;
esac
#Leave time for sync to occur
echo -n Wait for sync to complete then press Y
read input
#Change to correct directory
cd /Users/username/library
if [ "$?" = "0" ]; then
pwd
else
echo Cannot change directory!
exit 1
fi
#Copy “Calendars” directory to ../Calendars.bak
cp -Rf ./Calendars ./Calendars.bak
if [ "$?" = "0" ]; then
echo Calendar backup completed.
else
echo Cannot backup Calendar, quitting!
exit 1
fi
#Prompt to turn off sync on Mac and await Confirmation
echo -n Turn OFF Calendar sync on your Mac and press Y when done.
read input
case $input in
# Check for Y
Y ) echo You confirmed your Mac sync is turned OFF;;
# Check for anything else
* ) echo You did not type a Y, quitting.
exit 1;;
esac
#Prompt to turn off sync on iPhone (retaining data locally) and await Confirmation
echo -n Turn OFF Calendar sync on your iPhone, selecting KEEP ON MY iPHONE and press Y when done.
read input
case $input in
# Check for Y
Y ) echo You confirmed your iPhone sync is turned OFF;;
# Check for anything else
* ) echo You did not type a Y, quitting.
exit 1;;
esac
#Copy “Calendars.bak” directory to ../Calendars
cp -Rf ./Calendars.bak ./Calendars
if [ "$?" = "0" ]; then
echo Local copy of Calendar completed.
else
echo Cannot make local copy of Calendar, quitting!
exit 1
fi
#Notify Completed and await acknowledgement
echo Procedure Complete.
echo Your iPhone and Mac Calendars should be in sync and a copy held in /Users/username/Library/Calendars.bak.
echo The iCloud copy should have been removed.
echo Press any key to Quit.
read input
#Close App
exit 0