Hi Matt,
I have replied to you (though it's for anyone really) because we discussed this method earlier, been busy since then so it's taken a while.
Anyway, All, here it is so far, NOT TESTED YET, I'll probably do that tomorrow, so comments please (constructive ones please!) before then if possible. I also need to learn how to make it executable.
Replace username with your own login name.
I have built in safety checks where I can. It's a long time since I did any shell programming (1995 I think) so it was a bit of a relearning situation. I'm sure I'll get loads of comments from those who program all the time.
I am still a little concerned about what happens to the iCloud copy, espescially as it appears to be hosted by Microsoft and Amazon, it would be nice to know that it does get deleted but can 'they' be believed.
Chris.
_____________________________________________________________________________
#Sync Procedure
echo “ENSURE YOU HAVE AN UP_TO_DATE BACKUP!”
echo “ “
echo “/Users/username/Library/Calendars.bak will be overwritten by this procedure, rename it if you want to keep it! (If it exists).”
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, quiting!”
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 “Quiting.”
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 “Quiting.”
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, quiting!”
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, quiting.”
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, (select RETAIN DATA LOCALLY) 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, quiting.”
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, quiting!”
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/Libraries/Calendars.bak.”
echo “The iCloud copy should have been removed.”
echo “Press any key to Quit.”
read input
#Close App
exit 0