Search This Blog

Mac OS: backup and restore Microsoft Office 2011

I. A script to back up Microsoft Office 2011 into a zip file

#!/bin/bash

#
# File name: backup-office2011.sh
#

usage() {
    echo "Usage: $(basename $0) <dest-dir>"
}

if [[ -z $1 || ! -d $1 ]]; then
    echo "Destinated directory is not valid: $1" 1>&2
    usage
    exit
fi

DST=$1

zip -r $DST/MS_OFFICE2011_BACKUP.zip \
       /Applications/Microsoft* \
       /Applications/Remote\ Desktop\ Connection.app \
       /Library/Application\ Support\Microsoft \
       /Library/Automator \
       /Library/Fonts/Microsoft \
       /Library/Fonts\ Disabled \
       /Library/Internet\ Plug-Ins\SharePoint* \
       /Library/LaunchDaemons/com.microsoft.* \
       /Library/Preferences/com.microsoft.* \
       /Library/PrivilegedHelperTools/com.microsoft.* \
       /Library/Receipts/Office2011* \
       $HOME/Library/Application\ Support\Microsoft \
       $HOME/Library/Preferences/com.microsoft* \
       $HOME/Library/Preferences/Microsoft \
       $HOME/Documents/Microsoft\ User\ Data

II. Usage

  • Backup Microsoft Office 2011:
    ./backup-office2011.sh /Volumes/USBDISK/backups/
  • Restore Microsoft Office 2011 from the backup zip:
    cd /; sudo unzip /Volumes/USBDISK/backups/MS_OFFICE2011_BACKUP.zip

See Also

No comments:

Post a Comment