cancel -a (fastest way to lose a job, literally)

Bill Weaver bweaver at pacplanet.com
Tue May 22 05:58:35 PDT 2007


The confirmation that you are requesting would be a nice addition, but until that is implemented (if ever?), you can write a small script (in whatever shell you are utilizing) that the user would call first, asking the same questions as 'cancel -a' would, 'WARNING:  You are about to delete all print jobs, etc.....  Then interject a prompt from the user waiting until that is entered, and based on the user's response, actually call 'cancel -a' or exit out at that point.  Even better, rename 'cancel' to something of your choosing and actually call your script 'cancel'.  Utilize the same switches (i.e. -a, etc...) and if you are really feeling bold, implement all available choices from the original 'cancel' application.  Obviously this would all be lost on a upgrade of the O/S or CUPS, etc.. so keep track of your changes and add them back as needed.  We do this sort of thing all the time here to protect the users (and the admins!) from doing dumb things that we all do.  Hope that helps.


> angelb wrote:
> > Hello all.
> >
> > I noticed "cancel -a" removes all jobs for ALL printer queues at brute
> > force without regards to sex, color, origin, title, salary, etc.
> >
> > Without additional control; ie, an argument or a confirmation, this
> > command is rather dangerous and just waiting for the unsuspecting
> > victim to come by.
> >
> > How easy it is to just type "cancel -a", forgetting the que name, and
> > hit the ENTER key.
> >
> > The following command would probably suffice if cancelling all jobs
> > from all printer queue is truly desired:
> >
> > cupsclient# cancel -a ALL
> >
> > If not, a confirmation should be displayed:
> >
> > cupsclient# cancel -a
> > You're about to lose your job, are you sure?[y/n] n
> >
> > Where n, would be the default and have the admin/user makes the
> > final decision.
> >
> > While I don't see any reason, at the moment except for a sabotage :),
> > to delete all production jobs, this option to remove all jobs from ALL
> > printer queues is, IMHO, not necessary.
> >
> > Is this something we could place in feature request?
>
> Yeah, go ahead.  This is no different than "rm -rf /" and other
> similarly "destructive" commands, though, but I'm OK with adding
> a confirmation prompt.
>
> (FWIW, you have to be an admin to run cancel -a...)
>
> --
> ______________________________________________________________________
> Michael Sweet, Easy Software Products           mike at easysw dot com
> Internet Printing and Publishing Software        http://www.easysw.com





More information about the cups mailing list