Xref: utzoo unix-pc.general:2978 comp.sys.att:6596 Path: utzoo!utgpu!watmath!uunet!bfmny0!tneff From: tneff@bfmny0.UUCP (Tom Neff) Newsgroups: unix-pc.general,comp.sys.att Subject: Re: crontab Daemon-from-Hell Message-ID: <14373@bfmny0.UUCP> Date: 3 Jun 89 00:48:55 GMT References: <19071@cup.portal.com> Reply-To: tneff@bfmny0.UU.NET (Tom Neff) Followup-To: unix-pc.general Organization: ^ Lines: 31 In article <19071@cup.portal.com> thad@cup.portal.com (Thad P Floryan) writes: > #sccs "@(#)uucp:uudemon.day 1.1" > # 'perform once per day at 0400 hours' > . > . > cd /usr/spool/uucppublic > find . -type f -mtime +30 -exec rm -f {} \; This is dangerous if run as root. If anything - disk error, anything - happens to make /usr/spool/uucppublic unavailable, you will wipe your file structure. There are three things one can do - not mutually exclusive. 1) Trap the cd failure as follows - cd /usr/spool/uucppublic || exit 1 2) Perform the find explicitly rather than relatively: find /usr/spool/uucppublic -type f -mtime ... etc etc 3) Safest of all, and what I do - put this stuff in uucp's cron rather than root's at all. It's also OK to let the root cron entry do an 'su uucp' first. The best thing to do, and what I'll do tomorrow after reading the AQA, is add (2) to (3). This may render the 'cd' irrelevant but who cares. -- Tom Neff UUCP: ...!uunet!bfmny0!tneff "Truisms aren't everything." Internet: tneff@bfmny0.UU.NET