Re: Inventory of HD contents with date/time and path info
Re: Inventory of HD contents with date/time and path info
- Subject: Re: Inventory of HD contents with date/time and path info
- From: Roger_Jolly <email@hidden>
- Date: Fri, 19 Jul 2002 13:30:34 +0200
Well, I've just seen how this looks on list and to avoid problems, please
not that were the script reads
[^
]*
You should put
[^ ]*
That is a "[" a "^" a space a "]" and a "*"
Roger
on 19-07-2002 12:48, Roger_Jolly at email@hidden wrote:
>
Hi Mike,
>
>
Here are some ideas. ;-)
>
I'm just going to give the Unix commands, because wrapping them in do shell
>
scripts doesn't really improve readability with all that quoting and
>
escaping. Besides, now I just have to test the Unix commands and don't have
>
to worry about the Applescript. :)
>
First generate a list of your current system:
>
>
cd / ; find . -print0 | xargs -0 ls -ld | sed 's/^[^ ]*[ 0-9]*[^ ]*[^0-9]*[^
>
]* //' | sed -n 's:^\([^\.]*\)\./\(.*\):/\2 \1:p' | sort > ~Desktop/List1
>
>
To translate: go to the root directory, find all files and folders in that,
>
give them one at a time to ls so it can produce a list of all the items
>
(treating directories as if they were files, because you want information on
>
them.) Next remove everything before the modification date with a sed
>
command, followed by one that puts the date after the filename, getting rid
>
of the annoying dot at the beginning of it to produce absolute paths.
>
Finally sort it. (That's probably not necessary, but better be safe.)
>
>
You'll probably want to save this list somewhere, so I redirected the output
>
(saved) it to the file List1 on the desktop. You should replace this with a
>
location of your own, probably something in the tmp folder.
>
>
If you just are interested in the files and not the folders, you should do
>
this:
>
>
find . -type f -print0 | xargs -0 ls -ld | sed 's/^[^ ]*[ 0-9]*[^
>
]*[^0-9]*[^ ]* //' | sed -n 's:^\([^\.]*\)\./\(.*\):/\2 \1:p' | sort >
>
~Desktop/List1
>
>
List1 now contains as complete a list of your system as you can get as user.
>
To do better, you'll probably should do the do shell script with
>
administrator privileges. (That still leaves some things outside of your
>
reach, like the content of the cron jobs folder, but it's highly unlikely an
>
installer will put something in there.)
>
>
Now change your system someway.
>
>
Run the command again, but give another destination. Something like:
>
>
cd / ; find . -print0 | xargs -0 ls -ld | sed 's/^[^ ]*[ 0-9]*[^ ]*[^0-9]*[^
>
]* //' | sed -n 's:^\([^\.]*\)\./\(.*\):/\2 \1:p' | sort > ~Desktop/List2
>
>
Now you've got two sorted files with (practically) everything that's on your
>
system. Time to compare them. First everything that was on your system, but
>
has been removed by the installer:
>
>
comm -23 ~Desktop/List1 ~Desktop/List2
>
>
Finally, the things that were added to your system:
>
>
comm -13 ~Desktop/List1 ~Desktop/List2
>
>
If you want just the paths, you should pipe the result through sed.
>
Something like:
>
>
comm -13 ~Desktop/List1 ~Desktop/List2 | sed 's/\(.*\) .* .* ..:../\1/'
>
>
Hope this helps,
>
>
Roger
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.