Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change

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

Comment on Re: running Perl scripts in the background
Download Code

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://626174]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (4)
As of 2015-11-28 23:18 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (746 votes), past polls