How do you remove old jobs from CUPS ?

Discussion in 'Apple' started by Darren Granger, Apr 8, 2005.

  1. When I go to http://127.0.0.1:631/

    I see a list of old completed or cancelled jobs going back months.

    Is CUPS getting these from a log somewhere ? How can I get rid of this record
    of old print jobs.

    Thanks
     
    Darren Granger, Apr 8, 2005
    #1
    1. Advertisements

  2. Darren Granger

    Tom Stiller Guest

    I have added the following to my '/etc/daily.local' file:

    find /var/spool/cups -type f -ctime +7 -exec rm -f {} \;
    find /var/spool/cups/tmp -type f -ctime +3 -exec rm -f {} \;

    and the following to my '/etc/weekly.local' file:

    echo ""
    echo -n "Rotating log files (local):"
    cd /var/log
    for i in secure.log cups/access_log cups/error_log cups/page_log; do
    if [ -f "${i}" ]; then
    echo -n " $i"
    if [ -x /usr/bin/gzip ]; then gzext=".gz"; else gzext=""; fi
    if [ -f "${i}.3${gzext}" ]; then mv -f "${i}.3${gzext}"
    "${i}.4${gzext}"; fi
    if [ -f "${i}.2${gzext}" ]; then mv -f "${i}.2${gzext}"
    "${i}.3${gzext}"; fi
    if [ -f "${i}.1${gzext}" ]; then mv -f "${i}.1${gzext}"
    "${i}.2${gzext}"; fi
    if [ -f "${i}.0${gzext}" ]; then mv -f "${i}.0${gzext}"
    "${i}.1${gzext}"; fi
    if [ -f "${i}" ]; then mv -f "${i}" "${i}.0" && if [ -x
    /usr/bin/gzip ]; then gzip -9 "${i}.0"; fi; fi
    touch "${i}" && chmod 640 "${i}" && chown root:admin "${i}"
    fi
    done




    Note: the lines that are *not* indented are continuations of the lines
    immediately above them.

    The addition to /etc/daily.local retains only the last eight days of
    cups jobs, while the /etc/weekly.local additions maintain a rolling four
    week log of cups activity.
     
    Tom Stiller, Apr 8, 2005
    #2
    1. Advertisements

  3. Many thanks for the tip Tom, will try it out.
     
    Darren Granger, Apr 8, 2005
    #3
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.