LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
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 05-27-2009, 06:55 AM   #1
snoopy1
Member
 
Registered: Jun 2007
Posts: 44

Rep: Reputation: 15
Quota alert via Wall for user via Cron


I have students on a small NFS+NIS network. Quotas are enabled and if the user types "quota" on their workstation they can see their status. I created a small script to grab the exit code of quota and to wall a message if they are over.

Since my students are like any other student (unreliable, lazy) they don't bother to check their quotas much and thus what I'd like is for each workstation to run this script every 5 mins or so (to bug them with wall messages).

I could create a crontab for each user, but this is a pita, what with copying over the file, making sure it exists when I create new users etc.

If I put it in the /etc/crontab then it wont run quota for the current KDE user.

What's the best approach to use?
 
Old 05-31-2009, 05:24 AM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599
Dunno about "best" but you could retrieve name of current Xorg/X11 display user (PID of KDM/GDM is PPID in Xorg/X11/.*-session DM and the DM is run as the user), get quota stats for that user as root account user, set up Zenity/Gdialog to display warning on $DISPLAY, set up cronjob and don't forget to export DISPLAY variable. 5 minutes seems excessive though. And wy not just enforce quota and let them figure it out by themselves if they hit the limit?..
 
Old 05-31-2009, 07:49 PM   #3
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 7.7 (?), Centos 8.1
Posts: 18,238

Rep: Reputation: 2712Reputation: 2712Reputation: 2712Reputation: 2712Reputation: 2712Reputation: 2712Reputation: 2712Reputation: 2712Reputation: 2712Reputation: 2712Reputation: 2712
I agree with unSpawn's last..
quota comes with soft and hard limits. Set those up, add a login msg to mention the limits, then just let them work it out if they hit a limit.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
user quota 91change Linux - Newbie 1 08-05-2008 07:04 AM
Fedora 8 selinux blocks root cron but not user cron Infinity Fedora 7 11-29-2007 08:21 AM
quota.user or aquota.user outbackjack Linux - General 1 07-04-2006 07:30 AM
Alert user password change ust Linux - Software 1 09-08-2003 05:09 AM
About user quota... raymond Linux - General 4 08-27-2003 12:01 AM

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

All times are GMT -5. The time now is 06:57 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