CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Need a Custom or Prewritten Perl Program?: I need a program that...:
Perl system administration problem

 



tmac17
New User

Jan 31, 2009, 5:03 AM

Post #1 of 5 (2533 views)
Perl system administration problem Can't Post

I am new to perl and i got an assignment question that to perform the following. I have no clue to start so I am just wondering if there's any expert here can help me with it. I know that you guys probably wouldn't border to write up the actual program so any reference reading on each question would be much appreciate!!
Thanks guys,

In systems that offer many services/task to help users such as web server and disk quota system. Your task is to develop a system administration tool (called fixme.pl) using perl program that will allow administrator to;

Question 1
Grant 60 MB of the hard drive space from server for each new user and to
modify if the existing user has no quota granted.

Question 2
Force temporary users on the system to expire in 90 days from the creation
day.

Question 3
Generate the system quota report on the last day of every month and send
this report to L.pham@sga.edu.au

Question 4
Add new web access account so that the user can upload web files into (1
mark) /home/username/www and these web files could display from
http://localhost/~username


gnix
Novice

Feb 19, 2009, 5:30 AM

Post #2 of 5 (2460 views)
Re: [tmac17] Perl system administration problem [In reply to] Can't Post

Hi,

Question 1: I am learning English and I don't understand what you want.

Question 2: If you know all the temporary users you can change the Expire field in the /etc/shadow line of every user. The Expire field displays the number of days since January 1, 1970.

Question 3: Do you have the Mail::Mailer module? If yes, the following code can be useful.


Code
#!/usr/bin/perl -w 

use Mail::Mailer;

$type = 'mail';
$mailprog = Mail::Mailer->new($type);

%headers = (
'To' => 'you@domain.com',
'From' => 'me@domain.com',
'Subject'=> 'Reports'
);

$mailprog->open(\%headers);
print $mailprog `quotaon -av`;
$mailprog->close();


Be careful that I didn't test this code.

Question 4: To do that you have to edit your httpd.conf. Uncomment "UserDir public_html" and comment "UserDir disable". Create the public_html directories and set the permissions as described in the httpd.conf.

gnix


FishMonger
Veteran / Moderator

Feb 19, 2009, 6:35 AM

Post #3 of 5 (2456 views)
Re: [gnix] Perl system administration problem [In reply to] Can't Post

gnix,

It's great that you're here helping others, but please don't provide complete answers to someones homework assignment. When dealing with homework questions, it's better to give guidance and point to resources, but not to give solutions.

Question 1: deals with setting disk quotas
man quota
man setquota
http://search.cpan.org/~tomzo/Quota-1.6.3/Quota.pm

Question 2:
man usermod
http://search.cpan.org/~ghenry/Samba-LDAP-0.05/scripts/smbldap-usermod

Question 3:
See answer to question 1
MIME::Lite http://search.cpan.org/~rjbs/MIME-Lite-3.024/lib/MIME/Lite.pm
Net::SMTP http://search.cpan.org/~gbarr/libnet-1.22/Net/SMTP.pm


gnix
Novice

Feb 19, 2009, 6:40 AM

Post #4 of 5 (2454 views)
Re: [FishMonger] Perl system administration problem [In reply to] Can't Post

Sorry, I didn't understand that was an homework. The next time I will read more carefully.

gnix


tmac17
New User

Feb 19, 2009, 2:33 PM

Post #5 of 5 (2443 views)
Re: [gnix] Perl system administration problem [In reply to] Can't Post

THANKS A LOT ginx and fishmonger
Really appreciate that

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives