Description of problem: Version-Release number of selected component (if applicable): 2.9.6-1.2.1 (but probably others, e.g. RHEL4 tmpwatch-2.9.1-1) How reproducible: Allways Steps to Reproduce: 1. Make symlinks to files or directories. 2. Run tmpwatch (without --all option) on directory with symlinks that is older than specified. Actual results: Symlinks deleted Expected results: Symlinks not deleted Additional info: Man page says: "... only removes empty directories and regular files." Attached briefly tested patch which corrects this.
Created attachment 128605 [details] Do not accept symlink for deletion
I'd prefer just updating the documentation, I can't see any reason not to remove the symbolic links. Have you encountered a case where removing symbolic links is not desirable?
Yes, we use tmpwatch to clean a temporary work directory in high-performance computing (a common setup in HPC). The users frequently set up directories and symlinks in the work area in advance of starting their jobs. Having to recreate the symlinks each time the tmpwatch has run through is a hassle for the users. As the symlinks takes up almost no space, the users see it as natural that it should not be deleted. You could of course add a --nosymlinks option (like the --nodirs option).
I'm not too happy about adding yet another option, but it's probably the best we can do; tmpwatch-2.9.7 (in rawhide) therefore supports --nosymlinks (-l). Thanks for your report.