LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 08-30-2005, 11:59 AM   #1
tbeehler
Member
 
Registered: Aug 2003
Location: Washington State, USA
Distribution: Mainly RH 9.0
Posts: 227

Rep: Reputation: 30
File Server Reporting Software


In the spirit of open source, I've decided to share a little project that I've been working on with everyone. I was wanting some sort of software that would report on who had mp3's, wma's, movies and such on the network share and send me an email report. Everything that I found didn't work well or was too expensive. So here's what I did: I created a cron job that looked like this:


"locate *.mp3>/Sharedfolder/Reports/Music/report.txt | locate *.wma > /Sharedfolder/Reports/Music/report.txt"

These lines create a small text file with a line by line report of all mp3's and wma's on the drive. This cron job is ran locally on the file server. Then on my machine (Windows unfortunately) I run this batch file every night in the Scheduled Tasks:

"start /w sendemail.exe -u N:\Reports\Music\report.txt -f yourfromemailaddress@domainname.com -s serveripaddress:serverportaddress -t yourdestinationemailaddress@domainname.com -u Unauthorized Music Files -m Unauthrorized Music Report -a N:\Reports\Music\report.txt"

The sendemail.exe program is a command line email program that can be found here:

http://caspian.dotconf.net/menu/Soft...Email-v152.zip


That's pretty much it. Every night, the report gets created and every night the sendemail program sends it to me via attachment. Because I am running Thunderbird configured a certain way, (I don't know off the top of my head), the attachment is automatically previewed for me. Anyways, this is a nice, simple solution for those of you out there needing a reporting software idea. If you have anything to add, please feel free to do so. I'm always open to new ideas and ways around a problem. Now the only issue I've ran into is I can't seem to do more then 2 items at a time (mp3's and wma's for example) I'd like for it to report mp3's, wma's, m4a's, etc. but that seems to get all screwy when I try for more then 2 items at a time. Anyways, enjoy!

Travis
 
Old 08-31-2005, 09:00 PM   #2
Matir
LQ Guru
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Debian, Arch
Posts: 8,507

Rep: Reputation: 128Reputation: 128
While I appreciate your contribution, I'd like to offer a suggestion for an improvement. First off, locate depends on the database being up to date. I'd use find. For example:
Code:
find / -iname '*.mp3' -o -iname '*.wma' -o -iname '*.m4a' -o -iname '*.m4p' > reportfile
 
Old 09-01-2005, 10:13 AM   #3
tbeehler
Member
 
Registered: Aug 2003
Location: Washington State, USA
Distribution: Mainly RH 9.0
Posts: 227

Original Poster
Rep: Reputation: 30
Oh, I had forgotten to mention that I do an updatedb everynight at midnight. But I like your idea better. It seems to fix my multiple file extensions problem. Thanks for the tip!

Travis
 
Old 09-01-2005, 11:33 AM   #4
Matir
LQ Guru
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Debian, Arch
Posts: 8,507

Rep: Reputation: 128Reputation: 128
No problem. Most systems do perform updatedb regularly, and your technique would be faster in that case. If you do want to use locate, you could always do something like:
Code:
( locate *.mp3 ; locate *.wma ; locate *.m4a ; locate *.mpg ) > reportfile
 
Old 09-01-2005, 11:53 AM   #5
tbeehler
Member
 
Registered: Aug 2003
Location: Washington State, USA
Distribution: Mainly RH 9.0
Posts: 227

Original Poster
Rep: Reputation: 30
It never occured to me that I could do multiple commands by using a simple ; between them. I was always under the impression that I had to pipe the info from one command to another with | But then again I'm from the olden days and I'm so used to Microsoft, that I am finding that Linux has all these neat little features. I've been using Linux off and on again for the past 5 years, but have seriously gotten into it for the last year or so. Our company is relatively small, so Linux has made a big impact on our servers in terms of uptime, stability, and performance. Plus, I can do all of our maintenance late at night without bothering people, so locate seemed to be the best idea at the time, but I have tried your idea out and it works way better. Thanks again for all the helpful tips!

Travis
 
Old 09-01-2005, 12:43 PM   #6
Matir
LQ Guru
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Debian, Arch
Posts: 8,507

Rep: Reputation: 128Reputation: 128
No problem. It's what we're here for.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
SARG -Squid Reporting Software sf49football Linux - Software 3 12-03-2008 02:18 PM
Better bug tracking/reporting software? Alternative to bugzilla? jon_k Linux - Software 1 07-11-2005 03:03 AM
can we configure a Linux server with mail server,file server and web server kumarx Linux - Newbie 5 09-09-2004 06:21 AM
Web-based reporting tool for MS SQL Server nkendrick Linux - Software 0 06-27-2004 12:02 PM
logging and reporting on multiple firewalls to a syslog server cyph3r7 Linux - Security 2 04-13-2004 04:16 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 07:47 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration