Forum Moderators: bakedjake
As it stands I can output the files perfectly but I want to prevent a surfer stumbling on the script and executing it. My problem is that I've read 'the "other" group consists of everyone else -- most imporantly, the web server falls into the "other" category' when I would've expected the server i.e. cron to be USER.
TIA
/www/virtual/yourdomain.com/
Then you have your /cgi-bin/,/htdocs/,/logs/ etc simply place your script outside of these folders in your home directory above.
A surfer will not be able to execute this script since they can not access it from the web. If you have shell access you can execute it from shell.
Don't forget to add the necessary command to your cron file (which should be outside your web accessible folders too).
Example:
30 1 * * * perl /full/path/to/backup.cgi
The best solution probably would be to create a new user. Limit access to your script to this user and add it to that user's crontab. See the manual page for crontab (1) on your system.
Keep mind though the user will need to have the necessary permissions for crons to work. For example if the user doesn't have access to a specific command then it can't access it.
The best protection though is simply locate it outside your web accessible directory both the cgi-bin and htdocs/public_html/whatever HTML is served from.
Good luck.