#!/bin/csh -f # quick # ----------------------------------------------------------------------------- # Shell script to do a quick backup to hotswap computer and/or USB drive # and/or trident web server, with options to do more complete backups. # Focus is on being as quick as possible by default, and still being able # to do a more complete job later when time allows, as though a more # complete job had been done originally. # Modes: # - USB thumbdrive only: # - If "Verbatim" option: # - Only backup fred tree to Verbatim USB drive # - Skip all the rest below # - Default (at least daily): # - Copy all modified ~/fred files into fully populated /var/Quick/full/fred # moving previous versions of files to newly created sparse directory # /var/Quick/new_timestamp/fred # - Delete from /var/Quick/new_timestamp/fred all files not worth backing up # - If FireWire connected to hotswap: # - Copy all modified ~/fred files to ~/fred on hotswap # - Copy /var/Quick/new_timestamp/fred to hotswap # - Else if AirPort connected to hotswap, optionally: # - Copy all modified ~/fred files to ~/fred on hotswap # - Copy /var/Quick/new_timestamp/fred to hotswap # - If USB drive plugged in: # - Copy all modified ~/fred files to ~/fred on USB # - Copy /var/Quick/new_timestamp/fred to USB # - If trident server accessible: # - Copy all modified ~/fred files to trident server # - Note: Do NOT bother copying all sparse backups to trident. # Requires too much space, and we already have the old # incrementals on this laptop and the hotswap and the USB drive. # - Full (daily, if fast enough): # - If "full", "catchup", or "review" option: # - If FireWire connected to hotswap: # - Tell hotswap to copy all modified ~/fred files to /var/Quick/full/fred # - Else if AirPort connected to hotswap, optionally: # - Tell hotswap to copy all modified ~/fred files to /var/Quick/full/fred # - Review (when I have time to review changes): # - If "review" option: # - Carefully review all changes to make sure no files were corrupted, # and update various *.old directories. # - Catch up (after being away from hotswap and/or USB): # - If "catchup" option: # - If FireWire connected to hotswap: # - Copy all uncopied /var/Quick folders to hotswap # - Else if AirPort connected to hotswap, optionally: # - Copy all uncopied /var/Quick folders to hotswap # - If USB drive plugged in: # - Copy all uncopied sparse /var/Quick folders to USB # - Note: Do NOT bother copying all sparse backups to trident. # Requires too much space, and we already have the old # incrementals on this laptop and the hotswap and the USB drive. # - Other (copy other files also: fred2, fred3, etc., pictures, etc.) # - If "other" option: # - If FireWire connected to hotswap: # - Copy other files to hotswap # - Else if AirPort connected to hotswap, optionally: # - Copy other files to hotswap # - If USB drive plugged in: # - Copy other files to USB # - If trident server accessible: # - Copy other files to trident server # ----------------------------------------------------------------------------- # Usage: See Usage section below or run with -h or --help to see usage. # Assumptions: # Effects: # - Copies files and optionally updates .quick.timestamp # Notes: # Implementation Notes: # Portability Issues: # Revision History: # $Log$ # ----------------------------------------------------------------------------- set timestamp = `date "+%Y_%m_%d__%H_%M_%S"` set source_relative = "fred" set source_root = "/Users/fred/${source_relative}" set stage_root = "/var/Quick" set full_relative = "full" set stage_full = "${stage_root}/${full_relative}/${source_relative}" set stage_sparse = "${stage_root}/${timestamp}/${source_relative}" set usb_drive_name = "SEAGATE2TB" set usb_drive = "/Volumes/$usb_drive_name" set usb_root = "${usb_drive}/Quick" set usb_full = "${usb_drive}/Backup/${source_relative}" set usb_sparse = "${usb_root}/${timestamp}/${source_relative}" set hotswap1 = "mbp3" set hotswap2 = "mbp3" # Same as hotswap1 for now. No firewire options. set trident = "$TRIDENT" set hotswap1_wait_millisecs = 1600 set hotswap2_wait_millisecs = 1600 set trident_wait_millisecs = 1600 # Keep these wait times small. hotswap should respond # quickly if available. If the connection is slow, we # probably don't want to do the file transfer now anyhow. # But keep them long enough to avoid false negatives, # failing when waiting longer would have succeeded. # Even 800 often seems too small lately. if ("$1" == "-h" || "$1" == "--help") then echo "Usage: $0:t [-f | -c | -r | -o | -t]" echo " -f = Update ${stage_full} on hotswap also" echo " -c = Catch up -- copy all ${stage_root}/timestamps to USB/hotswap" echo " -r = Review all changes and update USB full backup" echo " -o = Backup all other files (fred2, fred3, etc.)" echo " -t = Only backup fred tree to Verbatim 32GB USB drive" exit 1 endif # Get and check options set option_full = "false" if ("$1" == "-f") then set option_full = "true" shift endif set option_catchup = "false" if ("$1" == "-c") then set option_catchup = "true" shift endif set option_review = "false" if ("$1" == "-r") then set option_review = "true" shift endif set option_other = "false" if ("$1" == "-o") then set option_other = "true" shift endif set option_Verbatim = "false" if ("$1" == "-t") then set option_Verbatim = "true" shift endif # Copy some files to DropBox to make them accessible on my phone # Note: Use .txt for small files so they open in the native text editor, # but .doc for larger files since they're too big and must be opened # in whatever opens .doc files, which seems to be able to handle # larger files. cp -v ~/fred/admin/remind.lis ~/fred/Dropbox/remind.txt cp -v ~/fred/admin/phoneboo.lis ~/fred/Dropbox/phonebook.doc cp -v ~/fred/admin/JerryTrip.txt ~/fred/Dropbox/JerryTrip.txt if ("${option_Verbatim}" == "true") then # Only backup fred tree to Verbatim USB drive printheader -t "Copy source to /Volumes/Verbatim/backup/fred" df -h # Determine whether Verbatim USB is found, giving the user a chance # to fix it. while (1 == 1) if (-d "/Volumes/Verbatim/backup/fred") then break endif echo "Can't find /Volumes/Verbatim/backup/fred. Must be plugged in." set prompt = "Retry (y/n)? " set retry = `promptloop "${prompt}" y n` if ("$retry" == "n") then echo "/Volumes/Verbatim/backup/fred skipped. Aborting..." exit endif end # Don't create. Causes problems if USB drive not yet mounted. # Already exists anyhow. # mkdir -p -v /Volumes/Verbatim/backup/fred # Warning: Using --del in combination with --exclude can cause problems. # If the target directory already contains excluded files, # perhaps from running this script before adding the --exclude, # such files are NOT deleted from the target when they're gone # from the source, and can cause target directories to not be # empty and thus also not deleted. This reports lines like: # "cannot delete non-empty directory: Mozilla/TBird/Profile" echo "rsyncupdate --log --del ~/fred/ /Volumes/Verbatim/backup/fred" rsyncupdate --log --del \ --exclude=/.ivy2/cache \ --exclude=/Balanced \ --exclude=/BurnFolders \ --exclude=/CPP \ --exclude=/Dropbox \ --exclude=/Eclipse \ --exclude=/Emantix \ --exclude=/HHL/FromHans/Art \ --exclude=/HHL/HHLWeb/.git \ --exclude=/HHL/HHLWeb/media \ --exclude=/Habitat \ --exclude=/InfrTrac \ --exclude=/Java \ --exclude=/MS \ --exclude=/Mozilla/TBird/Profile/global-messages-db.sqlite \ --exclude=/Mozilla/TBird/Profile/Mail/mail.bristle.com/filterlog.html \ --exclude=/Mozilla/Firefox.old \ --exclude=/Mozilla/TBird/Profile/Cache \ --exclude=/Mozilla/TBird/Profile/cache2 \ --exclude=/Mozilla/TBird.old \ --exclude=/OpenCV \ --exclude=/Visibiz \ --exclude=/Website.old \ --exclude=/admin.old \ --exclude=/bat.old \ --exclude=/bin.old \ --exclude=/bristle.old \ --exclude=/family.old \ --exclude=/family/Dad \ --exclude=/mac/Library \ --exclude=/mac/fred/Library \ --exclude=/ntbin.old \ --exclude=/sts \ --exclude=/website/bristle/WebStats \ --exclude=frozen \ --exclude=old \ --exclude=\*.old \ --exclude=cache \ --exclude=Cache \ --exclude=\*-cache \ --exclude=.DS_Store \ ~/fred/ /Volumes/Verbatim/backup/fred set rc = $status if ($rc != 0) then beep "Error copying ${source_root} to /Volumes/Verbatim/backup/fred" exit $rc endif df -h # No need for delay on mbp5. Errors are not occurring like they were # on mbp3. # printheader -t "Wait 30 seconds to avoid errors ejecting Verbatim" # sleep 30 # Had to add delay again after move from Sandisk USB drive to Verbatim. #?? Why? printheader -t "Wait 30 seconds to avoid errors ejecting Verbatim" sleep 30 printheader -t "Eject /Volumes/Verbatim" diskutil_eject Verbatim df -h settitle -h exit 0 endif # Determine whether hotswap is found, giving the user a chance to fix it. set use_hotswap1 = "false" set use_hotswap2 = "false" while (1 == 1) set hotswap1_found = "false" ping -c1 -W${hotswap1_wait_millisecs} ${hotswap1} >& /dev/null # -c1 = Ping only one time # -W = Number of millseconds to wait for reply. if ($status == 0) then set hotswap1_found = "true" endif set hotswap2_found = "false" ping -c1 -W${hotswap2_wait_millisecs} ${hotswap2} >& /dev/null if ($status == 0) then set hotswap2_found = "true" endif # Default to hotswap1 if available if ("${hotswap1_found}" == "true") then set use_hotswap1 = "true" echo "Using ${hotswap1}" break endif echo "${hotswap1} not found. Must be awake and using FireWire." # Otherwise, default to hotswap2 if available if ("${hotswap2_found}" == "true") then set use_hotswap2 = "true" echo "Using ${hotswap2}" break endif echo "${hotswap2} not found. Must be awake and using Airport." # Skip this. Changed above to default to hotswap2 w/o prompting # # Use hotswap2 if explicitly chosen # if ("${hotswap2_found}" == "true" && "${use_hotswap2}" == "true") then # echo "Using ${hotswap2}" # break # endif # if ("${hotswap2_found}" == "true") then # echo "${hotswap2} found." # else # echo "${hotswap2} not found. Must be awake and using AirPort." # endif set prompt = "Retry both (r)," set responses = "r" if ("${hotswap2_found}" == "true") then set prompt = "${prompt} use ${hotswap2} (u)," set responses = "${responses} u" endif set prompt = "${prompt} or skip hotswap update (s)? " set responses = "${responses} s" set retry = `promptloop "${prompt}" ${responses}` if ("$retry" == "u") then set use_hotswap2 = "true" break endif if ("$retry" == "s") then break endif end # Point at the chosen hotswap set use_hotswap = "false" if ("${use_hotswap1}" == "true") then set use_hotswap = "true" set hotswap = "${hotswap1}" else if ("${use_hotswap2}" == "true") then set use_hotswap = "true" set hotswap = "${hotswap2}" else echo "Skipping update of both ${hotswap1} and ${hotswap2}." echo "Can update later via $0:t -c" endif # Determine whether USB is found, giving the user a chance to fix it. while (1 == 1) set usb_found = "false" if (-d "${usb_drive}") then set usb_found = "true" break endif echo "Can't find ${usb_drive}. Must be plugged in." if ("${use_hotswap}" == "true") then echo "OK. ${hotswap} will be used." echo "Can update ${usb_drive} later via $0:t -c" break endif set prompt = "${hotswap1} and ${hotswap2} both not used." set prompt = "${prompt} Retry ${usb_drive} (y/n)? " set retry = `promptloop "${prompt}" y n` if ("$retry" == "n") then echo "${hotswap1}, ${hotswap2}, and ${usb_drive} all not used." echo "Warning: No remote backup will be done." break endif end # Determine whether trident is found, giving the user a chance to fix it. while (1 == 1) set trident_found = "false" echo "Pinging ${trident}..." ping -c1 -W${trident_wait_millisecs} ${trident} >& /dev/null # -c1 = Ping only one time # -W = Number of millseconds to wait for reply. if ($status == 0) then set trident_found = "true" endif if ("${trident_found}" == "true") then echo "Found ${trident}" break endif echo "${trident} not found. WiFi/Internet problem?" set prompt = "Retry (r), or skip trident update (s)? " set responses = "r s" set retry = `promptloop "${prompt}" ${responses}` if ("$retry" == "s") then break endif end set rc = 0 # Copy files into ~/fred that are required to reside elsewhere and can't # be symlinked from there to ~/fred. rsyncupdate --del ~/.ssh/ ~/fred/.ssh.copy # Stage to local full and sparse directories for ease of comparison and # casual recovery printheader -t "Create local full and sparse" echo "Copying ${source_root} to ${stage_full} and ${stage_sparse}..." rsyncupdate --log --del \ --exclude=/Mozilla/TBird/Profile/global-messages-db.sqlite \ --exclude=/Mozilla/TBird/Profile/Mail/mail.bristle.com/filterlog.html \ --exclude=/Mozilla/TBird/Profile/Cache \ --exclude=/Mozilla/TBird/Profile/cache2 \ --exclude=.DS_Store \ --backup \ --backup-dir=${stage_sparse} \ ${source_root}/ ${stage_full} set rc = $status if ($rc != 0) then beep "Error copying ${source_root} to ${stage_full} and ${stage_sparse}" exit $rc endif echo "...Copying ${source_root} to ${stage_full} and ${stage_sparse}" echo "************************************************************************" # Delete, from sparse directory, files that don't need to be backed up #?? Could just use --exclude on the rsync above, right? Would save the #?? time to copy and delete them. Yes. I've now made that change. Can #?? get rid of these rm commands that delete caches and index. printheader -t "Delete Thunderbird *.msf files from sparse" echo "Deleting Thunderbird *.msf files from ${stage_sparse}..." find ${stage_sparse}/Mozilla/TBird/Profile/Mail -name "*.msf" -exec rm -v "{}" ";" echo "...Deleting Thunderbird *.msf files from ${stage_sparse}" echo "************************************************************************" printheader -t "Delete Thunderbird cache from sparse" echo "Deleting Thunderbird cache from ${stage_sparse}..." rm -v -R ${stage_sparse}/Mozilla/TBird/Profile/Cache/* rm -v -R ${stage_sparse}/Mozilla/TBird/Profile/cache2/* echo "...Deleting Thunderbird cache from ${stage_sparse}" echo "************************************************************************" printheader -t "Delete Thunderbird index DB from sparse" echo "Deleting Thunderbird index DB from ${stage_sparse}..." rm -v ${stage_sparse}/Mozilla/TBird/Profile/global-messages-db.sqlite echo "...Deleting Thunderbird index DB from ${stage_sparse}" echo "************************************************************************" # Copy source and sparse directories to hotswap if ("${use_hotswap}" == "true") then printheader -t "Copy source to ${hotswap}" ssh ${hotswap} mkdir -p -v ${source_root} echo "rsyncupdate --log --del ${source_root}/ ${hotswap}:${source_root}" rsyncupdate --log --del \ --exclude=/Mozilla/TBird/Profile/global-messages-db.sqlite \ --exclude=/Mozilla/TBird/Profile/Mail/mail.bristle.com/filterlog.html \ --exclude=/Mozilla/TBird/Profile/Cache \ --exclude=/Mozilla/TBird/Profile/cache2 \ --exclude=.DS_Store \ ${source_root}/ ${hotswap}:${source_root} set rc = $status if ($rc != 0) then beep "Error copying ${source_root} to ${hotswap}:${source_root}" exit $rc endif printheader -t "Copy sparse to ${hotswap}" ssh ${hotswap} mkdir -p -v ${stage_sparse} echo "rsyncupdate --log --del ${stage_sparse}/ ${hotswap}:${stage_sparse}" rsyncupdate --log --del ${stage_sparse}/ ${hotswap}:${stage_sparse} set rc = $status if ($rc != 0) then beep "Error copying ${stage_sparse} to ${hotswap}:${stage_sparse}" exit $rc endif else echo "Skipping update of both ${hotswap1} and ${hotswap2}." echo "Can update later via $0:t -c" endif # Copy source and sparse directories to USB if ("${usb_found}" == "true") then printheader -t "Copy source to ${usb_drive}" mkdir -p -v ${usb_full} echo "rsyncupdate --log --del ${source_root}/ ${usb_full}" rsyncupdate --log --del \ --exclude=/.ivy2/cache \ --exclude=/Mozilla/TBird/Profile/global-messages-db.sqlite \ --exclude=/Mozilla/TBird/Profile/Mail/mail.bristle.com/filterlog.html \ --exclude=/Mozilla/Firefox.old \ --exclude=/Mozilla/TBird/Profile/Cache \ --exclude=/Mozilla/TBird/Profile/cache2 \ --exclude=/Mozilla/TBird.old \ --exclude=/OpenCV \ --exclude=cache \ --exclude=Cache \ --exclude=\*-cache \ --exclude=.DS_Store \ ${source_root}/ ${usb_full} set rc = $status if ($rc != 0) then beep "Error copying ${source_root} to ${usb_full}" exit $rc endif printheader -t "Copy sparse to ${usb_drive}" mkdir -p -v ${usb_sparse} echo "rsyncupdate --log --del ${stage_sparse}/ ${usb_sparse}" rsyncupdate --log --del ${stage_sparse}/ ${usb_sparse} set rc = $status if ($rc != 0) then beep "Error copying ${stage_sparse} to ${usb_sparse}" exit $rc endif else echo "Skipping update of ${usb_drive}." echo "Can update later via $0:t -c" endif if ("${option_full}" == "true" || "${option_catchup}" == "true" || "${option_other}" == "true" || "${option_review}" == "true") then # Tell hotswap to backup into its fully populated /var/Quick if ("${use_hotswap}" == "true") then printheader -t "Copy ${hotswap} full to ${hotswap} stage" ssh ${hotswap} mkdir -p -v ${stage_full} echo "ssh ${hotswap} rsyncupdate --log --del ${source_root}/ ${stage_full}" ssh ${hotswap} rsyncupdate --log --del \ --exclude=/Mozilla/TBird/Profile/global-messages-db.sqlite \ --exclude=/Mozilla/TBird/Profile/Mail/mail.bristle.com/filterlog.html \ --exclude=/Mozilla/TBird/Profile/Cache \ --exclude=/Mozilla/TBird/Profile/cache2 \ --exclude=.DS_Store \ ${source_root}/ ${stage_full} set rc = $status if ($rc != 0) then beep "Error having ${hotswap} copy ${source_root} to ${stage_full}" exit $rc endif else echo "Skipping update of both ${hotswap1} and ${hotswap2}." echo "Can update later via $0:t -c" endif endif # Copy source directory to trident server if ("${trident_found}" == "true") then printheader -t "Copy source to ${trident}:/ebs2/backup/mbp5/fred" # No. Already created manually, with ownership and permissions set # trident sudo mkdir -vp /ebs2/backup/mbp5/fred # trident sudo chown fred:fred /ebs2/backup/mbp5/fred # trident sudo chmod 700 /ebs2/backup/mbp5/fred echo "rsyncupdate --log --del ~/fred/ ${trident}:/ebs2/backup/mbp5/fred" rsyncupdate --log --del \ --exclude=/.ivy2/cache \ --exclude=/Balanced \ --exclude=/BurnFolders \ --exclude=/CPP \ --exclude=/Dropbox \ --exclude=/Eclipse \ --exclude=/Emantix \ --exclude=/HHL/FromHans/Art \ --exclude=/HHL/HHLWeb/.git \ --exclude=/HHL/HHLWeb/media \ --exclude=/Habitat \ --exclude=/InfrTrac \ --exclude=/Java \ --exclude=/MS \ --exclude=/Mozilla/TBird/Profile/global-messages-db.sqlite \ --exclude=/Mozilla/TBird/Profile/Mail/mail.bristle.com/filterlog.html \ --exclude=/Mozilla/Firefox.old \ --exclude=/Mozilla/TBird/Profile/Cache \ --exclude=/Mozilla/TBird/Profile/cache2 \ --exclude=/Mozilla/TBird.old \ --exclude=/OpenCV \ --exclude=/Visibiz \ --exclude=/Website.old \ --exclude=/admin.old \ --exclude=/admin \ --exclude=/.ssh.copy \ --exclude=/bat.old \ --exclude=/bin.old \ --exclude=/bristle.old \ --exclude=/family.old \ --exclude=/family/Dad \ --exclude=/mac/Library \ --exclude=/mac/fred/Library \ --exclude=/ntbin.old \ --exclude=/sts \ --exclude=/website/bristle/WebStats \ --exclude=frozen \ --exclude=old \ --exclude=\*.old \ --exclude=cache \ --exclude=Cache \ --exclude=\*-cache \ --exclude=.DS_Store \ ~/fred/ ${trident}:/ebs2/backup/mbp5/fred set rc = $status if ($rc != 0) then beep "Error copying ${source_root} to ${trident}:/ebs2/backup/mbp5/fred" exit $rc endif settitle -h endif # Error if no remote backup done. if ("${use_hotswap}" != "true") then if ("${usb_found}" != "true") then beep "Error: No remote backup was done." exit 1 endif endif if ("${option_review}" == "true") then # Review changes to important files before overwriting the backup copies. printheader -t "Review changes" set prompt = "Review all changes before doing backup to ${usb_full} (y/n)? " set doreviewall = `promptloop "${prompt}" y n` if ($doreviewall == "y") then reviewall endif endif if ("${option_catchup}" == "true") then # Copy all staged directories to hotswap if ("${use_hotswap}" == "true") then printheader -t "Copy all ${stage_root} to ${hotswap}" ssh ${hotswap} mkdir -p -v ${stage_root} echo "rsyncupdate --log --del ${stage_root}/ ${hotswap}:${stage_root}" rsyncupdate --log --del ${stage_root}/ ${hotswap}:${stage_root} set rc = $status if ($rc != 0) then beep "Error copying ${stage_root} to ${hotswap}:${stage_root}" exit $rc endif else echo "Skipping update of both ${hotswap1} and ${hotswap2}." echo "Can update later via $0:t -c" endif # Copy all staged sparse directories to USB, but not the staged full # directory, since the USB drive needs only one copy of the full # directory, not one working copy and one staged copy like the # computers. if ("${usb_found}" == "true") then printheader -t "Copy all ${stage_root} to ${usb_drive}" mkdir -p -v ${usb_root} # Don't bother to delete from the USB drive. It's much bigger than the # local hard drives. May as well keep old copies of stuff. #??echo "rsyncupdate --log --del --exclude=/${full_relative} ${stage_root}/ ${usb_root}" #?? rsyncupdate --log --del --exclude=/${full_relative} ${stage_root}/ ${usb_root} echo "rsyncupdate --log --exclude=/${full_relative} ${stage_root}/ ${usb_root}" rsyncupdate --log --exclude=/${full_relative} ${stage_root}/ ${usb_root} set rc = $status if ($rc != 0) then beep "Error copying ${stage_root} to ${usb_root}" exit $rc endif else echo "Skipping update of ${usb_drive}." echo "Can update later via $0:t -c" endif endif if ("${option_other}" == "true") then # Copy all other directories to hotswap if ("${use_hotswap}" == "true") then printheader -t "Copy all other directories to ${hotswap}" set dest = "${hotswap}:/Users/fred/" set echo rsyncupdate --log --del ~/Fred2/ ${dest}/Fred2 rsyncupdate --log --del ~/Fred3/ ${dest}/Fred3 rsyncupdate --log --del ~/Fred4/ ${dest}/Fred4 rsyncupdate --log --del ~/Fred5/ ${dest}/Fred5 rsyncupdate --log --del ~/Fred6/ ${dest}/Fred6 rsyncupdate --log --del ~/Fred7/ ${dest}/Fred7 rsyncupdate --log --del ~/Fred8/ ${dest}/Fred8 rsyncupdate --log --del ~/Fred9/ ${dest}/Fred9 rsyncupdate --log --del ~/pingfred.log ${dest}/pingfred.log rsyncupdate --log --del ~/Setup/ ${dest}/Setup rsyncupdate --log --del ~/Books/ ${dest}/Books rsyncupdate --log --del ~/Pictures/Pictures/ ${dest}/Pictures/Pictures rsyncupdate --log --del ~/Audio/ ${dest}/Audio rsyncupdate --log --del ~/Videos/ ${dest}/Videos rsyncupdate --log --del ~/Computer/ ${dest}/Computer rsyncupdate --log --del ~/TBird.old/ ${dest}/TBird.old rsyncupdate --log --del ~/ITF.old/ ${dest}/ITF.old rsyncupdate --log --del ~/Cassady.old/ ${dest}/Cassady.old rsyncupdate --log --del ~/Reagan.old/ ${dest}/Reagan.old rsyncupdate --log --del ~/bristle.old/ ${dest}/bristle.old rsyncupdate --log --del ~/slideshow.old/ ${dest}/slideshow.old rsyncupdate --log --del ~/Brita/ ${dest}/Brita rsyncupdate --log --del ~/Carol/ ${dest}/Carol # Show what would have been updated for the following static places. # Should be no changes rsyncupdate --log --del ~/Dad/ ${dest}/Dad rsyncupdate --log --del ~/JAG/ ${dest}/JAG rsyncupdate --log --del ~/Marijke/ ${dest}/Marijke unset echo else echo "Skipping update of both ${hotswap1} and ${hotswap2}." echo "Can update later via $0:t -o" endif # Copy all other directories to USB if ("${usb_found}" == "true") then printheader -t "Copy all other directories to ${usb_drive}" set dest = "${usb_drive}/Backup" set echo rsyncupdate --log --del ~/Fred2/ ${dest}/Fred2 rsyncupdate --log --del ~/Fred3/ ${dest}/Fred3 rsyncupdate --log --del ~/Fred4/ ${dest}/Fred4 rsyncupdate --log --del ~/Fred5/ ${dest}/Fred5 rsyncupdate --log --del ~/Fred6/ ${dest}/Fred6 rsyncupdate --log --del ~/Fred7/ ${dest}/Fred7 rsyncupdate --log --del ~/Fred8/ ${dest}/Fred8 rsyncupdate --log --del ~/Fred9/ ${dest}/Fred9 rsyncupdate --log --del ~/pingfred.log ${dest}/pingfred.log rsyncupdate --log --del ~/Setup/ ${dest}/Setup rsyncupdate --log --del ~/Books/ ${dest}/Books rsyncupdate --log --del ~/Pictures/Pictures/ ${dest}/Pictures/Pictures rsyncupdate --log --del ~/Audio/ ${dest}/Audio rsyncupdate --log --del ~/Videos/ ${dest}/Videos rsyncupdate --log --del ~/Computer/ ${dest}/Computer rsyncupdate --log --del ~/TBird.old/ ${dest}/TBird.old rsyncupdate --log --del ~/ITF.old/ ${dest}/ITF.old rsyncupdate --log --del ~/Cassady.old/ ${dest}/Cassady.old rsyncupdate --log --del ~/Reagan.old/ ${dest}/Reagan.old rsyncupdate --log --del ~/bristle.old/ ${dest}/bristle.old rsyncupdate --log --del ~/slideshow.old/ ${dest}/slideshow.old rsyncupdate --log --del ~/Brita/ ${dest}/Brita rsyncupdate --log --del ~/Carol/ ${dest}/Carol # Show what would have been updated for the following static places. # Should be no changes rsyncupdate --log --del ~/Dad/ ${dest}/Dad rsyncupdate --log --del ~/JAG/ ${dest}/JAG rsyncupdate --log --del ~/Marijke/ ${dest}/Marijke unset echo else echo "Skipping update of ${usb_drive}." echo "Can update later via $0:t -o" endif # Copy all other directories to trident if ("${trident_found}" == "true") then printheader -t "Copy all other directories to ${trident}:/ebs2/backup/mbp5" set dest = "${trident}:/ebs2/backup/mbp5" set echo rsyncupdate --log --del ~/Fred2/ ${dest}/Fred2 rsyncupdate --log --del ~/Fred3/ ${dest}/Fred3 rsyncupdate --log --del ~/Fred4/ ${dest}/Fred4 rsyncupdate --log --del ~/Fred5/ ${dest}/Fred5 rsyncupdate --log --del ~/Fred6/ ${dest}/Fred6 rsyncupdate --log --del ~/Fred7/ ${dest}/Fred7 rsyncupdate --log --del ~/Fred8/ ${dest}/Fred8 rsyncupdate --log --del ~/Fred9/ ${dest}/Fred9 rsyncupdate --log --del ~/pingfred.log ${dest}/pingfred.log rsyncupdate --log --del ~/Setup/ ${dest}/Setup rsyncupdate --log --del ~/Books/ ${dest}/Books rsyncupdate --log --del ~/Pictures/Pictures/ ${dest}/Pictures/Pictures rsyncupdate --log --del ~/Audio/ ${dest}/Audio rsyncupdate --log --del ~/Videos/ ${dest}/Videos rsyncupdate --log --del ~/Computer/ ${dest}/Computer rsyncupdate --log --del ~/TBird.old/ ${dest}/TBird.old rsyncupdate --log --del ~/ITF.old/ ${dest}/ITF.old rsyncupdate --log --del ~/Cassady.old/ ${dest}/Cassady.old rsyncupdate --log --del ~/Reagan.old/ ${dest}/Reagan.old rsyncupdate --log --del ~/bristle.old/ ${dest}/bristle.old rsyncupdate --log --del ~/slideshow.old/ ${dest}/slideshow.old rsyncupdate --log --del ~/Brita/ ${dest}/Brita rsyncupdate --log --del ~/Carol/ ${dest}/Carol # Show what would have been updated for the following static places. # Should be no changes rsyncupdate --log --del ~/Dad/ ${dest}/Dad rsyncupdate --log --del ~/JAG/ ${dest}/JAG rsyncupdate --log --del ~/Marijke/ ${dest}/Marijke unset echo else echo "Skipping update of ${trident}:/ebs2/backup/mbp5." echo "Can update later via $0:t -o" endif endif df -h if ("${use_hotswap}" == "true") then ssh ${hotswap} df -h endif printheader -t "Eject $usb_drive" diskutil_eject $usb_drive_name df -h settitle -h if (-e /Volumes/Verbatim) then printheader -t "Re-trying eject of Verbatim since it's still mounted" diskutil_eject Verbatim df -h settitle -h endif exit $rc