Advertisement
themacdweeb

Backup-AdobeCS-Data-By-Array.sh

Oct 16th, 2013
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 3.58 KB | None | 0 0
  1. #!/bin/sh
  2.  
  3. # Adobe CS Back-up Tool
  4. # Copyright ©2012, David Koff for the J. Paul Getty Trust
  5. #
  6. # ---------------------------------------------------------------------------
  7. # 1. Force quits any open Adobe application
  8. # 2. Backs up key folders of ANY version of Photoshop, Illustrator, InDesign
  9. # 3. Limited to the "workstation" account
  10. # ---------------------------------------------------------------------------
  11.  
  12.  
  13. #----------------------------------------------------------
  14. #   Variables
  15. #----------------------------------------------------------
  16.  
  17. #-----Assignments
  18. SCRIPTNAME=$0
  19. user405=ard
  20.  
  21. #--- Set Logging
  22. exec >> "/Library/Logs/Getty Installations.log" 2>&1
  23.  
  24. #-----Directories & Files
  25. backup="/Users/workstation/AdobeBackup"
  26. prefs="/Users/workstation/Library/Preferences/"
  27. il="/Applications/Adobe Illustrator"
  28. id="/Applications/Adobe InDesign"
  29. ps="/Applications/Adobe Photoshop"
  30.  
  31. #-----Array
  32. cs=( CS3 CS4 CS5 CS5.5 CS6 ) # use of array allows us to add later releases
  33.  
  34.  
  35. # ---------------------------------------------------------
  36. # timestamp
  37. # ---------------------------------------------------------
  38. echo "                                   "
  39. echo "###################################"
  40. echo "########## Beginning Log ##########"
  41. echo "##### Adobe CS backup Script ######"
  42. echo "#### `date "+%A %m/%d/%Y %H:%M"` #####"
  43. echo "###################################"
  44. echo "                                   "
  45.  
  46. # ---------------------------------------------------------
  47. # Forcequit Any Adobe Processes
  48. # ---------------------------------------------------------
  49. pid=`ps -ax | grep Adobe | cut -c 1-5`
  50. kill $pid
  51.  
  52.  
  53. # ---------------------------------------------------------
  54. # the actual backup
  55. # ---------------------------------------------------------
  56.  
  57. for i in "${cs[@]}"
  58. do
  59.     if [ -d "$il $i" ]; then
  60.         echo "Illustrator $i exists, now backing up to $backup
  61.         mkdir -p $backup/Illustrator\ $i
  62.         cp -Rpv "$il $i/Plug-ins.localized" $backup/Illustrator\ $i/
  63.         cp -Rpv "$il $i/Presets.localized" $backup/Illustrator\ $i/
  64.         cp -Rpv $prefs/Adobe\ Illustrator\ $i\ Settings "$backup/Illustrator $i/"
  65.     else
  66.         echo "No install of Illustrator $i exists.
  67.     fi
  68.    
  69.     if [ -d "$ps $i" ]; then
  70.         echo "Photoshop $i exists, now backing up to $backup
  71.         mkdir -p $backup/Photoshop\ $i
  72.         cp -Rpv "$ps $i/Plug-ins" $backup/Photoshop\ $i/
  73.         cp -Rpv "$ps $i/Presets" $backup/Photoshop\ $i/
  74.         cp -Rpv $prefs/Adobe\ Photoshop\ $i\ Settings "$backup/Photoshop $i/"
  75.     else
  76.         echo "No install of Photoshop $i exists.
  77.     fi
  78.    
  79.     if [ -d "$id $i" ]; then
  80.         echo "InDesign $i exists, now backing up to $backup
  81.         mkdir -p $backup/InDesign\ $i
  82.         cp -Rpv "$id $i/Plug-ins" $backup/InDesign\ $i/
  83.         cp -Rpv "$id $i/Presets" $backup/InDesign\ $i/
  84.         cp -Rpv $prefs/Adobe\ InDesign "$backup/InDesign $i/"
  85.     else
  86.         echo "No install of InDesign $i exists.
  87.     fi
  88. echo "                                    
  89. done
  90.  
  91. # make back-up folder editable by user
  92. if [ -d $backup ]; then #OK
  93.     echo "backup folder exists."
  94.     chown -R workstation:staff $backup #OK
  95. else
  96.     echo "no backup folder to change."
  97. fi
  98.  
  99. # ---------------------------------------------------------
  100. # timestamp
  101. # ---------------------------------------------------------
  102. echo "                                    "
  103. echo "###################################"
  104. echo "########## End of Log ##########"
  105. echo "#### `date "+%A %m/%d/%Y %H:%M"` ####"
  106. echo "###################################"
  107. echo "                                    
  108.  
  109. open -a Console /Library/Logs/Getty\ Installations.log ## opens log for fieldtech to examine
  110.  
  111.  
  112. exit 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement