logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

remrun — copy a file to a remote host and execute it

Authors

       Peter Pentchev ⟨roam@ringlet.net

Bugs

       No, thank you :) But if you should actually find any, please report them to the author.

Debian                                            March 6, 2022                                        REMRUN(1)

Description

       The remrun utility copies the specified file to the remote host using SSH  under  a  temporary  filename,
       executes it on the remote side, then removes the temporary file.  By default, the remote program does not
       have  access to the current process's standard input stream; the -s option has to be passed explicitly to
       enable that.

       As a special case, if “-” (a single dash) is passed as  the  filename  argument,  remrun  will  read  the
       contents  of  the  standard  input,  store it into a temporary file, and then copy and execute that file,
       removing it afterwards.  This is incompatible with the -s (--stdin) option.

       The remote host to transfer the file to may be  specified  in  two  ways:  either  as  a  [username@]host
       pattern, or as a ssh://[username@]host[:port][/] URI.

       Note  that  the  sha256sum(1)  tool is used both locally and remotely to make sure that the file has been
       transferred correctly.  Its use may be overridden for the local host by the -C option, and for the remote
       one by the -c option; both commands are passed to the shell, so they may be comprised of  more  than  one
       word, e.g.  “sha256 -r”.

       The remrun utility accepts the following command-line options:

       -h      Display program usage information and exit.

       -N      No-operation mode - do not perform any changes, simply report what would have been done.

       -s      Allow  the  remote program access to the standard input stream.  Please note that this will cause
               some SSH clients to read the whole input stream, regardless of whether the  remote  program  only
               needs a line or two!

       -V      Display program version information and exit.

       -v      Verbose mode - display information about the actions performed.

Diagnostics

       The remrun utility exits 0 on success, and >0 if an error occurs.

Environment

       The operation of the remrun utility is not directly influenced by any environment variables.

Examples

       Copy the whoami.sh file over to the “server” host, logging in as the “jrl” user account, then run it:

             remrunjrl@serverwhoami.sh

       Do  the  same,  but  for  a  remote  host  that  runs FreeBSD and another command must be used instead of
       sha256sum:

             remrun-c'sha256-r'jrl@serverwhoami.sh

       Specify the commands to run directly:

             printf'uname-a\ndate-R\n' | remrunjrl@server-

Files

       The operation of the remrun utility is not directly influenced by the contents of any files.

History

       The remrun utility was written by Peter Pentchev in 2021.

Name

       remrun — copy a file to a remote host and execute it

See Also

mktemp(1), sha256sum(1), ssh(1)

Standards

       No standards were harmed during the production of the remrun utility.

Synopsis

remrun   [-Nsv]   [--noop]  [--stdin]  [--verbose]  [-Clocal_cksum_command]  [-cremote_cksum_command]
              destinationfilename [args...]
       remrun [-V | --version | -h | --help | --features]

See Also