Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris

Re: running Perl scripts in the background

by hawtin (Prior)
on Jul 12, 2007 at 08:51 UTC ( #626174=note: print w/replies, xml ) Need Help??

in reply to running Perl scripts in the background

I have run a number of these 'monster' processes, for example last year I converted my complete MP3 collection to a different bitrate by resampling my FLAC files, the process took 3 weeks. My assumption is always that we will have a power-cut at the worst moment, so I normally control the process with a loop like (from memory):

my $results_dir = "results"; mkdir $results_dir,0755 if(!-d $results_dir); foreach my $next_step (list_steps()) { next if(-r "$results_dir/$next_step.done"); $res = do_step($next_step); my $fh = IO::File->new(">$results_dir/$next_step.done"); print $fh $res; $fh->close(); } print "All steps done\n";

Of course I normally add the date, some other interesting details to the results files and a lot more checking

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://626174]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (3)
As of 2018-05-27 03:57 GMT
Find Nodes?
    Voting Booth?