My rsync Backup Script

This code will look for the differences between folders, replace the old files with the new files after moving the old ones into a separate folder, and display the activity. It’s stored in /Users/GG/bin/ and simply named backup:

#!/bin/sh
if [ $# -ne 2 ]; then
echo 1>&2 Error, Usage: $0 sourcePath destDir
exit 127
fi
theDate=`date '+%y%m%d%H%M%S'`
destPath="/Volumes/Motherlode/Backup"
theIncr="$destPath/$2-$theDate"
scriptOut="$destPath/progress.txt"
echo "------------------------------------------------------------" > "$scriptOut"

echo; echo; echo "$1$2 -> $theDate" >> "$scriptOut"
rsync -ablPvz --backup-dir="$theIncr" --delete --progress "$1$2/" "$destPath/$2" >> "$scriptOut"

echo "------------------------------------------------------------" >> "$scriptOut"

cat "$scriptOut"
exit 0

Run these lines in a BBEdit worksheet.

backup “/Users/GG/” “bin”
backup “/Users/GG/Documents/” “Save”
backup “/Users/GG/Documents/” “Databases”
backup “/Users/GG/Library/” “Application Support”
backup “/Users/GG/Library/” “Mail”
backup “/Volumes/Cornucopia/Library/” “WebServer”

Command-z to get rid of the progress reports.

I remember (wrote this script years ago) that there was something critical about one slash character in the rsync parameter list to get the behavior exactly right. Also, although the results for this user are fine, the script’s execution gives “Permission denied” error messages for directories belonging to others.

Advertisements

Export Addresses and Bookmarks

I’m starting to backup before updating system.

For saving Safari Bookmarks, there is a switch that can be turned on to display a Debug menu:

% defaults write com.apple.Safari IncludeDebugMenu 1

The Save folder in my Documents is part of my backup routine so that is where I export a copy of the bookmarks:

Safari > Debug > Export Bookmarks… -> Documents/Save/

Address Book makes it easier with a command in its File menu:

Address Book > File > Backup Database -> Documents/Save/

Tiger creeps up on Panther

I’ve notice that Terminal in my Panther system has a different prompt and is not giving me the help and man pages it used to. Something needs to be reset and I don’t feel like looking for it. Maybe I’ll just switch to Tiger and forget about getting Panther back to where it was. Friends have been suggesting that since Tiger first came out, but I hesitated to install it then because, until now, nothing was broke.

Spotlight and Dashboard look interesting, too, by the way.

Piecing it Together Again

Rebuilding the system, from the disks that came with the G5, without also reinstalling the bundled software, proved a mistake. I had just finished doing all the online updates going from 10.3.5 to 10.3.9 (required for Filemaker 8.5), when I noticed blank cds weren’t being recognized. I had to go back again to those system disks to reinstall iDVD, but mistakenly reinstalled 10.3.5 again. Let me warn you, this is TOO easy a mistake to make!

Then I had to do what Adobe calls a HotFix for Dreamweaver. Then reinstall Xcode, Stuffit, and Adobe Reader.

Alas, now my printer wouldn’t work. Turns out the reactivation secret is to access the hidden print driver installer by using “Go to Folder…” in the Finder (at least I learned one new thing during this debacle):

Finder > Go > Go to Folder > /Volumes/Mac OS X Install Disc 1/System/Installation/Packages/HewlettPackardPrinterDrivers.pkg

turn on printer
Printer Setup Utility

Shell Script to Compare Installations

I wrote a little shell script to run in BBEdit. It creates a uniquely named text file containing the names of all/most of the files in my system library folder. It uses the ls command with the -AR option to recursively list subdirectories encountered. I call it CatSysLib.sh:

#!/bin/sh
cd /System/Library
theDate=`date '+%y%m%d%H%M%S'`
destPath="/Volumes/Cornucopia/Catalogs"
theCat="$destPath/$theDate.txt"
ls -AR > $theCat
exit 0

By comparing the new system with the old one that didn’t work, I discovered an odd extention: LexarFilterScheme.kext.

A Google search revealed that THIS was the cause of my DVD not playing commercial titles, to wit:

“One of our readers, has reported to us an incompatibility issue rather annoying between the Secure II software found in USB key from Lexar and MacOSX. Indeed, once the software is installed on the Mac, it becomes absolutely impossible to play any DVD (backup or movie DVD).”

I made sure not to reinstall that security software and used Disk Utility to reformat the flash memory of the Lexar JumpDrive.

Note: In the script above, the first line starts with a two character “shebang” which is a word formed from a corrupted combination of the number sign (hash) and the exclamation point (bang), kind of like the word “blog” is from web log.

blogitude

Recently I did a Software Update of Quicktime. There was a little warning attached to it that I brushed off. When later I tried to play a DVD, it didn’t work. Naturally I assumed it was the new version of Quicktime and decided to rebuild my system. A very rash action I admit. The least I could have done was some research to find the real cause and perhaps uninstall that version of Quicktime.

Anyway, getting the system back to were it was before the rebuild was a journey of a thousand steps. A lot of the information I needed came from technical blogs. This blog is my show of appreciation and perhaps a shortcut to others mired in similar painful circumstances.