We help IT Professionals succeed at work.

Automatically email system profiler

giozeno
giozeno asked
on
Does anyone know of an app or a script that automatically emails or uploads (via, say, FTP) the system profiler info?

i tried automating this terminal command: system profiler | mail -s "$HOSTNAME System Profiler Report" adress@domain.com and it seems to work sometimes....

This would be a great app to have for inventory purposes
Comment
Watch Question

Commented:
At what time do you want it to e-mail you the information (also multiple times).

I could give you a script for it.

Author

Commented:
well, for now, one-time-immediately would work...
my intention is to reduce the time it takes to do inventory.

would ftp be an option as well as email?

Author

Commented:
Would this be for applescipt or automator?
Commented:
Yes.

Here is the code for the system_profiler + upload. You need to paste it in an applescript.
do shell script "system_profiler > /Users/username/Documents/system_profiler.txt"
do shell script "curl -T uploadfile -u user:passwd ftp://ftp.upload.com/myfile"

Open in new window


And change the values. If it works than I'll give the instructions to create a cronjob for it. So it's done automaticly. If you want it.

Author

Commented:
Thanks. do you have one for emailing the file?
Commented:
Here you go:

do shell script "system_profiler > /Users/username/Documents/system_profiler.txt"
do shell script "/bin/mail -s "SUBJECT" "EMAIL-ADDRESS" < /Users/username/Documents/system_profiler.txt"

Open in new window

Commented:
Have you tried it?

Author

Commented:
Thanks. That worked perfectly

Explore More ContentExplore courses, solutions, and other research materials related to this topic.