Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: Preventing multiple instances

by afoken (Chancellor)
on Dec 18, 2020 at 00:13 UTC ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11125378]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (6)
As of 2024-04-20 00:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found