Best practice is to do that sort of thing via the crontab if you can. You want to design the systems you administer to look after themselves as much as possible, and removing old temp files is something that ought to be possible to do automatically.

If you have to log in yourself every few days to manually clean up the temp files, then what happens if you want to take 2 weeks holiday. (Or you have an accident and spend 2 weeks in hospital. You have better things to do than to do manual tidying that the system ought to be able to do for itself.

For other things that cannot be done automatically, as design pattern I have frequently seen in the past is to have a web front end that interacts with the user and gets a list of what needs doing. The list is then written to disc or into a database. Another more privileged process running as a demon, or from the cron reads the database or files and does the work.

For example a couple of years ago I was working on a Corporate Intranet site. There was a web based tool for adjusting user accounts, group memberships and privileges. The web front end ran as a mod-perl process in the web server, and was sand-boxed for security reasons. Each user account change was written to an unprivileged database by the web front end. Another demon ran as root, read the queue of pending changes from the database and made the necessary changes to the Unix NIS and Windows Active directory servers.


In reply to Re: Unlinking Files and Taint Mode by chrestomanci
in thread Unlinking Files and Taint Mode by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.