Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # UNIX AT Command
- ## Schedule command in PHP
- ```php
- $job = "echo '/usr/bin/php5 /path/to/file.php " . $IdYouWantToGive . " false > /dev/null 2>&1' | at now + 1 minute 2>&1";
- $exec = system($job);
- ```
- Build queue by cycling through items
- ```php
- $j = 0;
- /* ... { */
- $job = "echo '/usr/bin/php5 /path/to/file.php " . $IdYouWantToGiveForJob . " false > /dev/null 2>&1' | at now + " . round(($j+1)/3) . " minute 2>&1";
- $j++;
- /* } */
- ```
- ## Delete all entries from queue
- ```
- atrm $(atq | cut -f1)
- ```
- Then check completion with `atq`.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement