Jump to content

Self Destructing Php Script


rubing

Recommended Posts

Why not just have the script terminate itself (exit, die()) and write a file that tells it not to fully execute again?

 

pseudocode FTW. (and yes, the backticks will work as long as the directory is writable by the user the cronjob runs as)

 

<?php
if(is_file('/path/to/where/the/php_script/is/do_not_execute') { exit; }

// If it doesn't exit, then run the cronjob.
// insert scripting here

if(something_failed) { `touch /path/to/where/the/php_script/is/do_not_execute` }

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.