in reply to Gracefully exiting and restarting at a later time.
use strict; use warnings; my ($data, $mem); my $kb = ' ' x 1024**2; do { $data .= $kb; $_ = `ps -p $$ -o %mem`; ($mem) = m/(\d+\.\d+)/; } while ($mem < 50);
You could also have it check for a file named a certain thing (like exit.txt) and exit if it sees that as well, deleting before exit so you're prepped for the next run.
|
|---|