I have a directory that looks similar to this:
These files are located in: /some/location
drwxr-xr-x 23 someuser somegrp 4096 Feb 26 13:26 .
drwxr-xr-x 5 root system 256 May 18 2006 ..
-rw-r--r-- 1 someuser somegrp 1436 Nov 01 13:02 .eai
-rw------- 1 someuser somegrp 3276 Jan 23 2006 .old
-rwxr-xr-x 1 someuser somegrp 1290 May 19 2004 .someuser
-rw-r--r-- 1 someuser somegrp 30 Oct 06 10:43 .dxfcreated
drwxr-xr-x 2 someuser somegrp 4096 Feb 26 13:22 .ps
-rwxr-xr-x 1 someuser somegrp 729 Dec 05 08:27 .sde
-rw-r----- 1 someuser somegrp 0 May 16 2006 .sh_history
drwxrwxrwx 14 root system 4096 Mar 02 07:00 .snapshot
drwxr-xr-x 2 someuser somegrp 4096 Feb 26 13:22 Scripts
drwxr-xr-x 5 someuser somegrp 73728 Mar 02 03:57 LOGS
drwxr-xr-x 10 someuser somegrp 4096 Feb 26 13:25 SQL_LOGS
drwxr-xr-x 5 someuser somegrp 4096 Feb 26 13:22 dev
drwxr-xr-x 7 someuser somegrp 4096 Feb 26 13:22 utilities
What I want to be able to do is a 'rm -rf' in /some/location' to remove all files and directories EXCEPT .snapshot (and its subdirs/files). I've been playing with find and its various options, but havent had much luck in deleting everything BUT the .snapshot.
Have any of you gurus done something like this? If so, how did you do it?
These files are located in: /some/location
drwxr-xr-x 23 someuser somegrp 4096 Feb 26 13:26 .
drwxr-xr-x 5 root system 256 May 18 2006 ..
-rw-r--r-- 1 someuser somegrp 1436 Nov 01 13:02 .eai
-rw------- 1 someuser somegrp 3276 Jan 23 2006 .old
-rwxr-xr-x 1 someuser somegrp 1290 May 19 2004 .someuser
-rw-r--r-- 1 someuser somegrp 30 Oct 06 10:43 .dxfcreated
drwxr-xr-x 2 someuser somegrp 4096 Feb 26 13:22 .ps
-rwxr-xr-x 1 someuser somegrp 729 Dec 05 08:27 .sde
-rw-r----- 1 someuser somegrp 0 May 16 2006 .sh_history
drwxrwxrwx 14 root system 4096 Mar 02 07:00 .snapshot
drwxr-xr-x 2 someuser somegrp 4096 Feb 26 13:22 Scripts
drwxr-xr-x 5 someuser somegrp 73728 Mar 02 03:57 LOGS
drwxr-xr-x 10 someuser somegrp 4096 Feb 26 13:25 SQL_LOGS
drwxr-xr-x 5 someuser somegrp 4096 Feb 26 13:22 dev
drwxr-xr-x 7 someuser somegrp 4096 Feb 26 13:22 utilities
What I want to be able to do is a 'rm -rf' in /some/location' to remove all files and directories EXCEPT .snapshot (and its subdirs/files). I've been playing with find and its various options, but havent had much luck in deleting everything BUT the .snapshot.
Have any of you gurus done something like this? If so, how did you do it?