SHARE
TWEET

Untitled

a guest Jul 16th, 2019 65 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # UNIX AT Command
  2.  
  3. ## Schedule command in PHP
  4. ```php
  5. $job = "echo '/usr/bin/php5 /path/to/file.php " . $IdYouWantToGive . " false > /dev/null 2>&1' | at now + 1 minute 2>&1";
  6. $exec = system($job);
  7. ```
  8.  
  9. Build queue by cycling through items
  10. ```php
  11. $j = 0;
  12. /* ... { */
  13. $job = "echo '/usr/bin/php5 /path/to/file.php " . $IdYouWantToGiveForJob . " false > /dev/null 2>&1' | at now + " . round(($j+1)/3) . " minute 2>&1";
  14. $j++;
  15. /* } */
  16. ```
  17.  
  18. ## Delete all entries from queue
  19. ```
  20. atrm $(atq | cut -f1)
  21. ```
  22. Then check completion with `atq`.
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top