Sponsored Content
Full Discussion: Adobe application cleanup
Operating Systems OS X (Apple) Adobe application cleanup Post 302591694 by kleinboy on Friday 20th of January 2012 10:54:57 AM
Old 01-20-2012
I think I solved it. Not terrible, but figuring out how to have the shell not split the the paths took me a while. The rest was fairly easy.

I'm posting it down below. Does anyone see anything that will cause me grief? I've tested it a few times and it seems to work and isn't deleting anything like / so far. Any sanity checks that would be smart?
PHP Code:
#!/bin/sh

# adobecleanup4.sh

#
# Created by Aaron Robinson on 1/19/12.
# Copyright 2012 __MyCompanyName__. All rights reserved.

#Need to stop shell from interpreting spaces as separators
IFS='
'

#What CS vsersion do we want to search for. Use CS3 CS4 CS5 CS5.1, etc
searchstring="CS6"
currentTime=$(date +%H%M%S)

#Find all $searchstring folders within /Applicatons
for path in $(/usr/bin/find /Applications -maxdepth 1 -name "*${searchstring}"); do

   
folderpath=${path}
   
appname=`/bin/echo "${path}" | cut -d'/' -f3`
   
plistpath=${path}"/"${appname}".app/Contents/Info.plist"

   
#echo "Base folder path is "$path
   #echo "Application name is "$appname 
   #echo "Plist path is $plistpath"
   
   
if [ ! -${plistpath} ]; then
      
if [[ ${folderpath} =~ 'Adobe' ]]; then
         
#echo "DELETE: $plistpath does not exist"
         #echo "Deleting $folderpath"
         
echo Removing ${folderpath} >> /tmp/adobecleanup_${date}.txt
         
/bin/rm -Rf ${folderpath}
      
fi 
   
else
      /
bin/echo "LEAVE: "${plistpath}" exists"
   
fi

done

unset IFS

exit 
 

7 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

sendmail cleanup

What is the correct procedures to clean up /var/spool/mqueue? Any help appreciated. This directory gets really clogged up at times. :( :( (1 Reply)
Discussion started by: thomi39
1 Replies

2. AIX

Login ID cleanup

Hello I have many old IDs on my AIX and would like to know the simplest way of knowing the last time an ID was used. I am familiar with the "last" command. Thanks for any info :) (1 Reply)
Discussion started by: MILLERJ62
1 Replies

3. Shell Programming and Scripting

Help with cleanup

I am trying to add a unique string to a variable to prevent some name space collisions. DATAFILE=/u001/app/unica/affinium644/campaign/partitions/limited/tmp/ebf9aaah.t~# DATETIME=`date +%Y%m%d_%H%M%S` echo $DATAFILE > tmpnme.txt sed 's_/_ _g' tmpnme.txt > tmpnme2.txt DATA=$(cat tmpnme2.txt)... (2 Replies)
Discussion started by: whdr02
2 Replies

4. Shell Programming and Scripting

Cleanup script

Hi! I would like to write a script which remove some files, all beginning with the same prefix : prefix.1 doc/prefix.2 ../prefix.3 etc. So, I would create a file and chmod it executable. But I dont know how to pass a variable to a script. I would like to write something like ... (2 Replies)
Discussion started by: tipi
2 Replies

5. Solaris

/home cleanup

Hi All, I have this script for linux on cleaning up orphaned folder. But I need to use this on solaris 8/9/10 for user in $(ls | grep -v lost+found) ; do id $user >/dev/null 2>&1 if ] then ls -ld $user grep $user /etc/passwd fi done Can someone please convert this script? ... (1 Reply)
Discussion started by: itik
1 Replies

6. Programming

Application Cleanup during Linux Shutdown

I'm trying to do some cleanup (write open files) when Linux shuts down. I thought the right method would be to trap SIGTERM and do the necessary processing. Here's my sample code: #include <stdio.h> // for File I/O #include <signal.h> // for signals #include <unistd.h> // for sleep() void... (6 Replies)
Discussion started by: whatisron
6 Replies

7. Red Hat

How to Cleanup Multipathing

I have a server running redhat 5.5 and it has one SAN device presented to it as LUN9. How can I clean up the remaining entries. I cannot afford to interupt the service. Please assist. # multipath -l mpath0 (36000097000019260298953666633436) dm-11 EMC,SYMMETRIX \_ round-robin 0 \_ 2:0:0:9 ... (2 Replies)
Discussion started by: Tirmazi
2 Replies
All times are GMT -4. The time now is 08:26 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy