EnglishFrenchSpanish

Ad


OnWorks favicon

keep-one-running - Online in the Cloud

Run keep-one-running in OnWorks free hosting provider over Ubuntu Online, Fedora Online, Windows online emulator or MAC OS online emulator

This is the command keep-one-running that can be run in the OnWorks free hosting provider using one of our multiple free online workstations such as Ubuntu Online, Fedora Online, Windows online emulator or MAC OS online emulator

PROGRAM:

NAME


run-one - run just one instance at a time of some command and unique set of arguments
(useful for cronjobs, eg)

SYNOPSIS


run-one COMMAND [ARGS]

run-this-one COMMAND [ARGS]

run-one-constantly COMMAND [ARGS]

keep-one-running COMMAND [ARGS]

run-one-until-success COMMAND [ARGS]

run-one-until-failure COMMAND [ARGS]

DESCRIPTION


run-one is a wrapper script that runs no more than one unique instance of some command
with a unique set of arguments.

This is often useful with cronjobs, when you want no more than one copy running at a time.

run-this-one is exactly like run-one, except that it will use pgrep(1) and kill(1) to find
and kill any running processes owned by the user and matching the target commands and
arguments. Note that run-this-one will block while trying to kill matching processes,
until all matching processes are dead.

run-one-constantly operates exactly like run-one except that it respawns "COMMAND [ARGS]"
any time COMMAND exits (zero or non-zero).

keep-one-running is an alias for run-one-constantly.

run-one-until-success operates exactly like run-one-constantly except that it respawns
"COMMAND [ARGS]" until COMMAND exits successfully (ie, exits zero).

run-one-until-failure operates exactly like run-one-constantly except that it respawns
"COMMAND [ARGS]" until COMMAND exits with failure (ie, exits non-zero).

EXAMPLE


In one shell:

$ run-one rsync -azP $HOME $[email protected]:/srv/backup
foouser/
foouser/.bash_history
40298 100% 37.13MB/s 0:00:00 (xfer#1, to-check=3509/3516)
foouser/.viminfo
20352 100% 98.39kB/s 0:00:00 (xfer#3, to-check=3478/3516)
...
sent 746228 bytes received 413059 bytes 36802.76 bytes/sec
total size is 3732890955 speedup is 3219.99

In another shell, while the first is still running:

$ run-one rsync -azP $HOME $[email protected]:/srv/backup
$ echo $?
1

Another example... In one shell:

$ run-one top

In another shell:

$ run-one top
$ echo $?
1
$ run-this-one top
top - 17:15:36 up 1:43, 3 users, load average: 1.05, 1.04, 1.00
Tasks: 170 total, 1 running, 169 sleeping, 0 stopped, 0 zombie
...

And note that the process in the first shell was killed.

You might want to keep one ssh connection up and running all the time, with:

$ run-one-constantly ssh -N -C -L 3128:localhost:3128 -L 7778:localhost:7778 example.com
&

Use keep-one-running online using onworks.net services


Free Servers & Workstations

Download Windows & Linux apps

  • 1
    facetracknoir
    facetracknoir
    Modular headtracking program that
    supports multiple face-trackers, filters
    and game-protocols. Among the trackers
    are the SM FaceAPI, AIC Inertial Head
    Tracker ...
    Download facetracknoir
  • 2
    PHP QR Code
    PHP QR Code
    PHP QR Code is open source (LGPL)
    library for generating QR Code,
    2-dimensional barcode. Based on
    libqrencode C library, provides API for
    creating QR Code barc...
    Download PHP QR Code
  • 3
    Freeciv
    Freeciv
    Freeciv is a free turn-based
    multiplayer strategy game, in which each
    player becomes the leader of a
    civilization, fighting to obtain the
    ultimate goal: to bec...
    Download Freeciv
  • 4
    Cuckoo Sandbox
    Cuckoo Sandbox
    Cuckoo Sandbox uses components to
    monitor the behavior of malware in a
    Sandbox environment; isolated from the
    rest of the system. It offers automated
    analysis o...
    Download Cuckoo Sandbox
  • 5
    LMS-YouTube
    LMS-YouTube
    Play YouTube video on LMS (porting of
    Triode's to YouTbe API v3) This is
    an application that can also be fetched
    from
    https://sourceforge.net/projects/lms-y...
    Download LMS-YouTube
  • 6
    Windows Presentation Foundation
    Windows Presentation Foundation
    Windows Presentation Foundation (WPF)
    is a UI framework for building Windows
    desktop applications. WPF supports a
    broad set of application development
    features...
    Download Windows Presentation Foundation
  • More »

Linux commands

Ad