Cancel old print jobs in Ubuntu
If you see a message during a slow or hanging shutdown (press ESC to see messages) about a stop job is running for CUPS, wait 90 seconds ... it might be due to an old print job in the system.
Also, Ubuntu can remember an old print job, so that is is printed next time the printer is turned on, even if the computer has been turned off. This can be especially annoying if the print job was made by accident.
To prevent slow shutdowns and accidental printing from happening, a simple solution is to cancel all print jobs on a regular basis, like once an hour.
Simply add this command to Cron, and all print jobs should be purged.
Open Cron:
$ crontab -e
Add this command to cancel all print jobs once an hour:
# Purge print jobs 10 * * * * cancel -a
See print queue:
$ lpstat # see print queue
The comment (the text after the #
character) is added to able to quickly find it again by hitting Ctrl+R
("reverse-i-search") and type "pri".