Koozali.org: home of the SME Server

Change To Quotas Setup

Offline jmartin

  • ***
  • 58
  • +0/-0
    • http://www.ci.wayne.mi.us
Change To Quotas Setup
« on: January 27, 2005, 10:01:05 PM »
Instead of the current quota setup limiting the disk space for each user's home directory, e-mail, and any files owned by the user in information bays I would like to see the quota setup changed so that the disk space for each user only includes the user's home directory and e-mail and then a new ibay option to restrict ibay size with warnings sent to the admin.

Seems like this would be easier for the admin when a user is up against their limit then it's just a matter saying clean up email or home directory and if an ibay gets to large just tell the group to cleanup their shared directory.

If thats not possible then just adding the option to restrict ibay size would be nice.

Offline FreakWent

  • ****
  • 89
  • +0/-0
RE: Change to quotas setup
« Reply #1 on: February 05, 2005, 12:27:28 AM »
I think this is a great idea.  You should be able to do it yourself though by using the ibay user accounts. At bootup, have the system change the ownership of all the files in the ibay to the special user.

If you want to monitor the quotas via the web page you'll need to create your own special dummy user for each ibay and use that.

I can't see any reason why this shouldn't work but I haven't done it myself.  If I get a round tuit I'll let you know how it goes.[/quote]

Offline FreakWent

  • ****
  • 89
  • +0/-0
Flexbackup, multiple tapes and quotas for ibays.
« Reply #2 on: February 05, 2005, 04:01:04 AM »
First of all, I know nothing.  This feature could already exist, and I didn't even know.

This may completely screw up your server and I haven't discovered that yet.  I have no idea what I'm doing.

I know nothing.  I'm at tf@ft,net,au if you want something or you can tell me a better way to do this.

This works for me.  I've been struggling for two years with hard drives bigger than the tapes.  Can't backup -- tape full, job stops.  Crap.

It means file ownership in ibays gets clobbered, so this breaks user quotas and file ownership in general.

You need sets, so you need to get the new version of flexbackup, it's at
<http://flexbackup.sourceforge.net/RPMS/flexbackup-1.2.1-1.noarch.rpm>

So then you setup your own flexbackup.conf from templates, it should include lines like this

$set{'Wednesday'} = "/home/e-smith/files/ibays/install";

Do a different set and ibay for each weekday.

Even better is to set it up so it automatically scans the /ibays folder and will make a new set when a new ibay is added.  I can't do this myself because I know nothing.

Using nice templates fix up /sbin/e-smith/backup so that the actual command becomes
/usr/bin/flexbackup -set date +%A
So Monday it does the Monday set and so forth.

OK, Quotas.  Quotas are based on users not folders, so make some users in the usual way, named after the ibays:
installquota
gamequota
accountsquota

Whatever the ibays are called.  Now the files in each ibay need to be owned by the dummy user for the ibay, so make a new file in /etc/rc.d/init.d/quotainit
chmod +x that file, and it should contain:

#!/bin/bash
for i in ls /home/e-smith/files/ibays/; do
chown echo -n $i && echo quota -R /home/e-smith/files/ibays/$i/*
done

this means at every bootup it will set the ownership of all the files in an ibay to the dummy ibay user.
You also add a line in the backup file to run the quotainit script.  It would be better in the warnquota cronjob, but that's in perl and I know nothing.

Set the quotas to, say, 20% lower than the tape capacity.  It may take some tweaking but that's not so hard.

Happy happy joy joy!

Offline jmartin

  • ***
  • 58
  • +0/-0
    • http://www.ci.wayne.mi.us
Change To Quotas Setup
« Reply #3 on: February 10, 2005, 03:50:16 PM »
Thanks for the feedback haven't tested that yet but it seems like a good idea.

I wonder if there is a way to code a rule that says all files in an ibay are always owned by X user.  Although I don't know exactly what effects that would have on other services.

Thanks,
Jeff

Offline Brenno

  • *****
  • 208
  • +0/-0
Change To Quotas Setup
« Reply #4 on: July 29, 2005, 04:59:42 PM »
Along these lines, the quotas system should be able to span multiple filesystems.  If you're like me and you have multiple drives installed on your SME server, you'll find that the quotas are only read on one drive - not on any additional drives that you've mounted in /etc/fstab.

Since I have my user's email files mounted to a different disk, the quota management panel doesn't correctly report each user's disk usage and cannot enforce a quota on that user.

Heck, I even opened a bug on this and was told that SME did not support multiple filesystems, period.  You can view the bug here: http://no.longer.valid/mantis/bug_view_page.php?bug_id=0000125