Well im using a cron job to automaticly clear our timetable, and was woundering how I do it so it only alows the server to do it?

Could I just use this?
PHP Code:
if($REMOTE_ADDR == "localhost" || $REMOTE_ADDR == "127.0.0.1"