Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: Preventing multiple instances

by afoken (Canon)
on Dec 18, 2020 at 00:13 UTC ( #11125378=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    0 7 * * * /usr/local/bin/move-curtains open
    0 21 * * * /usr/local/bin/move-curtains close
    
  2. or download this
    0 0 * * * /usr/local/bin/sunrise-sunset
    51 6 * * * /usr/local/bin/move-curtains open
    13 21 * * * /usr/local/bin/move-curtains close
    
  3. or download this
    #!/usr/bin/perl
    use strict;
    ...
    say $pipe "$sunrise_hour $sunrise_minute * * * /usr/local/bin/move_cur
    +tains open"; # open at sunrise
    say $pipe "$sunset_hour $sunset_minute * * * /usr/local/bin/move_curta
    +ins close"; # close at runset
    close $pipe;
    
  4. or download this
    say $pipe "0 0 * * * $0"; # keep this script running every day at midn
    +ight
    
  5. or download this
    open my $pipe,'|-','crontab','-','-u','root' or die "Can't run crontab
    +: $!";
    
  6. or download this
    my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime()
    +;
    $year += 1900;
    die "Clock lost" if $year < 2020;
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (2)
As of 2021-05-11 13:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Perl 7 will be out ...





    Results (116 votes). Check out past polls.

    Notices?