#!/bin/csh -f #H# sync script for my Sony Clie #H# Backs up the palm RAM to ~/.pilot #H# Backs up the memory stick to ~/.pilot-ms #H# Uses rsync to copy both dirs into .pilot.old and .pilot-ms.old but doesn't --delete #H# That way all files ever installed on the palm are available there for restoration. #H# Later uses rsync again to backup all 4 dirs to another box just in case. #H# The script also pauses to allow the user to tell the Clie which data to send and #H# detects when the Clie is ready. #H# Note that all paths are hard coded to my home dir (/home/asylum/kmk) and my Clie #H# device files (/dev/usb/tts/1 and /dev/sdg1). # print usage info if needed if ($1 != "") exec sed -n -e '/^\#H\#/s/^....//p' $0 # Make the permanant .old archives. rsync --progress -va /home/asylum/kmk/.pilot/ /home/asylum/kmk/.pilot.old/ # Pause until the user hits HotSync on the Clie echo "Hit HotSync to continue..." while (! -e /dev/ttyUSB1) sleep 1 end # Do the backup of the Palm RAM with pilot-xfer pilot-xfer --illegal --port=/dev/ttyUSB1 --sync=/home/asylum/kmk/.pilot # Sync with plan sleep 2 echo "Hit HotSync to continue (ignore errors about SyncCM and passwords)..." while (! -e /dev/ttyUSB1) sleep 1 end #PilotManager -syncwith SyncPlan env LD_PRELOAD=/usr/lib/libpisock.so PilotManager -sync echo "" # Pause for the user to hit MSImport on the Clie echo "Hit MSImport to continue..." while (! -e /dev/disk/by-uuid/20EB-AA2E) #udevadm trigger sleep 1 end # Mount the clie and back it up. # Here is my fstab entry that matches my UID/GID: # /dev/sdg1 /clie vfat uid=12313,gid=100,fmask=133,dmask=022,quiet,user 0 0 mount -v /clie || exec echo "Problem mounting /clie." rsync -va --progress --delete --exclude=MSBackup/ --delete-excluded /clie/ /home/asylum/kmk/.pilot-ms/ umount -vl /clie sync # Make backups of all 4 directories on another server which is NFS mounted. # This is a completely optional step. rsync --progress -va --delete /home/asylum/kmk/.pilot asylum:/backup/pilot/ rsync --progress -va --delete /home/asylum/kmk/.pilot.old asylum:/backup/pilot/ rsync --progress -va --delete /home/asylum/kmk/.pilot-ms asylum:/backup/pilot/