copying corresponding language files

Please support our Shell Scripting advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Aug 2008
Posts: 1
Reputation: dotmac is an unknown quantity at this point 
Solved Threads: 0
dotmac dotmac is offline Offline
Newbie Poster

copying corresponding language files

 
0
  #1
Aug 29th, 2008
Hello fellows,

I'm on Mac OS X and have the following problem:

Using a common cleanup script I got rid of useless localizations, keeping all the english files:

Shell Scripting Syntax (Toggle Plain Text)
  1. find /Applications ~/Applications /Library ~/Library \( -iname '*.lproj' -and \! \( -iname 'en*' \) -and \! \( -path '/Library/Receipts/*' -or -path '~/Library/Receipts/*' \) \) -print0 | xargs -0 rm -frv {}

Unfortunately I forgot to also filter out all german files, which would have looked like this:

Shell Scripting Syntax (Toggle Plain Text)
  1. find /Applications ~/Applications /Library ~/Library \( -iname '*.lproj' -and \! \( -iname 'en*' -or -iname 'de*' -or -iname 'ger*' \) -and \! \( -path '/Library/Receipts/*' -or -path '~/Library/Receipts/*' \) \) -print0 | xargs -0 rm -frv {}

Since I happen to have a full backup of my system, I would be able to restore all removed german language files to their respective locations...

How could I achieve this??

I would perform the above search for the (still existing) english files...

Shell Scripting Syntax (Toggle Plain Text)
  1. find /Applications ~/Applications /Library ~/Library \( -iname '*.lproj' -and \! \( -iname 'en*' \) -and \! \( -path '/Library/Receipts/*' -or -path '~/Library/Receipts/*' \) \)

... which gives me the path for every file, like "/Applications/Foo.app/Contents/Resources/English.lproj"

And then I would need to go to "/Volumes/Backup" + the above path without the filename, look for "de.lproj" and "German.lproj" and copy whatever result to the original location...

Any ideas how this second part of the script would look like? I have no clue and I really don't want to restore hundreds of files manually...

Thanks in advance!
Reply With Quote Quick reply to this message  
Join Date: Oct 2007
Posts: 399
Reputation: eggi will become famous soon enough eggi will become famous soon enough 
Solved Threads: 47
eggi eggi is offline Offline
Posting Whiz

Re: copying corresponding language files

 
0
  #2
Aug 30th, 2008
What sort of backup did you do (ufsdump, netbackup, etc). You should just be able to restore based on a standard base directory and wildcards, like the find you did to get all the German files.

If you let me know what you're using to backup/restore, I may be able to help you out with a specific course of action.

Best wishes,

Mike
Linux and Unix Tips, Tricks and Individual Advice - The Linux and Unix Menagerie!
------------------------------------------------------------------------
The greatest viral marketing idea of all time, get your copy of this Free Report now!
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:




Views: 834 | Replies: 1
Thread Tools Search this Thread



Tag cloud for Shell Scripting
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC