Setting up quota allocations

In many organizations PaperCut NG is used to control and restrict users to sensible use by allocating a quota or allowance (a budget). For example a user may be allocated $10.00 a week. This type of control is particularly popular in schools and universities. The process of quota allocation can be automated via the Groups section.

To allocate a $10.00 a week to members of the Students group:

  1. Navigate to the Group section

  2. Add the Student group via Add/Remove Group if not already listed.

  3. Select the Student group

  4. Under the Quota Scheduling section, select a period of Weekly and enter 10.00 in the Schedule amount.

  5. Click the Apply button to save the change.

The Group Details screen

Figure 4.2. The Group Details screen

Credit will be assigned to group members at just past 12:00am (midnight) on the day of the schedule. Administrators can verify that this has taken place by inspecting log entries in the Application event log and/or users' transaction logs.

TaskTime

Daily Allocations

Applied at 12:10am every day (7 days a week).

Weekly Allocations

Applied at 12:20am on Sunday.

Monthly Allocations

Applied at 12:30am on the first day of the month.

Table 4.1. Quota schedule times

One potential issue associated with quota allocation in some organizations (for example Schools or Universities) is that users can "bank up" their quota allowance over time leading to excessive use at periods of the year such as the end of semester. The Only allow accumulation up to option can be used to implement a "use it or lose it" policy!

Advanced User Quota Management

Some organizations may require scheduling quota allocations for periods other than those available above. For example, an education organization may like to schedule quota allocation per term, semester (period) or academic year, which may not have set dates. This can be achieved by a manual update when necessary though Bulk user actions ... in the Users or Groups tab. More information is available in the section called “Bulk User Operations”.

It is also possible to automate the allocation of user quota through the use of Server Commands (see the section called “Server Commands (server-command)”) or XML Web Services (see the section called “The XML Web Services API”).

Automated Quota Allocation Example

One way to automate quota allocation is through the use of Server Commands. Following is an example of how to use Server Commands to automate quota allocation in a Microsoft Windows environment:

North Shore High would like to automate their quota allocation on a per-term basis. There are four terms in a year, and terms do not necessarily start on the same date every year. Junior students are to receive $5 per term printing budget, and senior students are to receive $10 per term. The domain has the groups junior-students and senior-students to reflect the students' grade.

Using the information from the section called “Server Commands (server-command)”, we can see that the Server Command adjust-user-account-balance-by-group will meet the needs of this situation. Create a batch file with a name like assign_term_quotas.bat with content similar to the following (depending on your environment):

cd "C:\Program Files\PaperCut NG\server\bin\win"
server-command adjust-user-account-balance-by-group "junior-students" \
    +5.00 "$5 term budget for junior students"
server-command adjust-user-account-balance-by-group "senior-students" \
    +10.00 "$10 term budget for senior students"
            

Note: backslash indicates text should appear on the same line.

Running this script will allocate $5 to all members of the group junior-students, and $10 to all members of the group senior-students. The script can then be scheduled to run at the specified dates by the use of a tool such as Windows Task Scheduler ( Control PanelScheduled TasksAdd Scheduled Task).