Need a script for automatically cleaning up /var/spool/cups directory

Hi Friends,

Actually in an linux server , there was printer jobs files occupying more space in /var/spool/cups so i want a script for deleting the files once in two week since i need the latest two weeks files.

Thanks in advance..Waiting for the script.

Use man find ("linux").

e.g. something like:

find /var/spool/cups -type f -mtime +14 -print0 | xargs -r0 echo rm

(remove the echo when you're sure it's finding the right files to remove)

1 Like

Read the find(1) man page. It contains all the information you need to write a oneliner script which will do what you are what.

1 Like