When printing to HP printer, I noticed that all printed files are saved to /var/spool/cups
.
Is it possible to avoid this from a privacy perspective?
Deleting the job files can be done with the cancel(1) command.
$ cancel -a -x
will remove all job files for the current user.
If you want CUPS to not save them at all, the PreserveJobFiles
directive can be added to cupsd.conf as described here:
https://opensource.apple.com/source/cups/cups-372/cups/doc/help/ref-cupsd-conf.html.in
(somewhere along the line Apple has stopped including this documentation file at opensource.apple.com, this seems to be the last version the file exists for, although CUPS itself is a higher version now)
Enable cups web interface to edit the cups.conf file in an easy way:
cupsctl WebInterface=yes
and press enterGo to the Cups web page at http://localhost:631/printers/ and see your installed printers.
In the top menu click 'Administration'
On the right you find a button 'Edit Configuration File'
There you can add the information to delete the history files. Mine looks like this (the 1800 makes the deamon wait for half an hour before deleting):
PreserveJobFiles 1800
PreserveJobHistory 1800
Click "Save Changes" and enter username/password of an admin user when prompted.
For more information see https://www.cups.org/doc/man-cupsd.conf.html
From the blog of the OP:
echo "PreserveJobHistory Off" | sudo tee -a /etc/cups/cupsd.conf
sudo launchctl unload /System/Library/LaunchDaemons/org.cups.cupsd.plist
sudo launchctl load /System/Library/LaunchDaemons/org.cups.cupsd.plist
Unfortunately, /etc/cups/cupsd.conf
sometimes gets overwritten during a macOS update. I have
grep -qe '^PreserveJobHistory Off$' /etc/cups/cupsd.conf || echo 'WARNING: CUPS history ENABLED'
in the startup file of the shell I use to warn me if this happens.