---
name: "kup"
section: "1"
platform: "linux"
package: "kup-client"
version: "0.3.6-4"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/kup"
---

# kup(1)

kernel.org upload utility

## NAME

kup - kernel.org upload utility

## SYNOPSIS

**kup** \[*global options*\] *command* \[**--** *command...*\]

## DESCRIPTION

This utility is used to upload files to *kernel.org* and other systems using the same upload system (**kup-server**).  Each upload is required to have a PGP signature, and the server will generate multiple compressed formats if the content uploaded is intended to be compressed.

Additionally, if the user has content from a [**git**(1)](/git/1.md) tree already on server, it is possible to reproduce the content server-side, thereby reducing bandwidth needs.  The user still has to generate the content locally and sign it.

## GLOBAL OPTIONS

- **-b**, **--batch**

  Instead of connecting to a remote host, output the protocol content to standard output.  The output from an arbitrary number of **kup** invocations can be concatenated into a single batchfile and then sent  to the server as a single session, e.g.:

```
cat batchfile | ssh -a -x -k -T [user@]host
```

- **-e**, **--rsh, --ssh** *command*

  **Override the default command used to connect to the server.  The** **default is set by the environment variable** **KUP\_RSH** **or if that is not set,** *ssh -a -x -k -T***.**

- **-H, --host** *\[user@\]host*

  **Override the default user and host to which to connect.  The default** **is set by the environment variable** **KUP\_HOST** **or if that is not set,** *kup.kernel.org***.**

- **-c, --subcmd** *subcommand*

  **After establishing the ssh connection, issue a subcommand in case the remote** **server is used in conjunction with an AuthZ tool like gitolite. Can also be set** **using the env variable** **KUP\_SUBCMD** **or if not set, no subcommand will be used (default kup-server behavior).**

## COMMANDS

**A series of commands can be specified on a single command line,** **separated by a double dash argument (--).**

**In all cases, PGP signatures are detached signature files** **corresponding to the** *uncompressed* **content.  If a** *remote\_path* **ends in** *.gz* **then** **gzip**, **bzip2** **and** **xz** **compressed files are generated on the server; otherwise the content is** **stored uncompressed.**

- **put** *local\_file* *signature\_file* *remote\_path*

  **Upload the file** *local\_file* **signed with** *signature\_file***.**  *local\_file* **can be compressed with** **gzip**, **bzip2** **or** **xz**; **this may reduce upload time.  The content will be stored compressed or** **uncompressed depending solely on the extension of** *remote\_path***.**

- **put --tar \[--prefix=\]** *remote\_tree* *ref* *signature\_file* *remote\_path*

  **Generate a tar archive file from ref** *ref* **of git tree** *remote\_tree* **(using git archive --format=tar) with** **signature** *signature\_file* **generated locally, and place it in** *remote\_path***.**

  **git archive has been found to be relatively stable, so this** **command is relatively robust to git version changes. The --prefix** **is passed to git archive verbatim.**

- **put --diff** *remote\_tree* *ref1* *ref2* *signature\_file* *remote\_path*

  **Generate a patch file between refs** *ref1* **and** *ref2* **of git** **tree** *remote\_tree* **(using git diff-tree -p) with signature** *signature\_file* **generated locally, and place it in** *remote\_path***.**

  **The output of git diff-tree has been found to vary between** **git** **versions, so successful use of this command may require the same** **version of** **git** **locally as on the server in order to produce a valid signature.**

- **mkdir** *remote\_path*

  **Create a new directory on the server.**

- **mv\|move** *old\_path* *new\_path*

  **Move the file or directory** *old\_path* **to** *new\_path***.  For a** **file, the** *.sign* **files are also moved, and for compressed files,** **all the compression formats are moved together.**

- **ln\|link** *old\_path* *new\_path*

  **Hard link the file or directory** *old\_path* **to** *new\_path***.  For a** **file, the** *.sign* **files are also linked, and for compressed files,** **all the compression formats are linked together.**

- **rm\|del\|delete** *old\_path*

  **Delete the file or directory** *old\_path***.  For a file, the** *.sign* **files are also deleted, and for compressed files, all the** **compression formats are deleted together.**

- **ls\|dir** *path...*

  **Lists back the contents of one or more directories on the server.**

## PATHNAME HANDLING

**Remote (server) pathnames all need to be absolute paths, starting with** **a slash (/).  The sole exception is** *new\_path* **for the mv** **and link commands, which if it is not absolute is taken to be** **relative to the** *old\_path* **minus the final component.  Similarly,** **if** *new\_path* **ends in a slash then the final component of** *old\_path* **will be appended.**

**For the** *put* **command, except when --tar or --diff** **is specified, if the** *remote\_path* **ends in a slash then the** **final (filename) component of** *local\_file* **will be appended to the** **final pathname.**

## CONFIG FILE

**Kup checks the presence of $HOME/.kuprc and can load the** **host** **and** **rsh** **parameters from the config file. The environment variables** **KUP\_HOST** **and** **KUP\_RSH** **will override the values set in this config file.**

**SAMPLE $HOME/.kuprc:**

```
host = user@kup.kernel.org
rsh  = /usr/bin/ssh -a -x -k -T
```

## EXAMPLES

**Generate a tarball locally, sign it, compress it, and upload it into /pub/foolib on the server:**

```
git archive --format=tar --prefix=foolib-1.0/ -o foolib-1.0.tar v1.0
gpg --detach-sign --armor foolib-1.0.tar
bzip2 -9 foolib-1.0.tar
kup put foolib-1.0.tar.bz2 foolib-1.0.tar.asc /pub/foolib/foolib-1.0.tar.bz2
```

**Generate a tarball locally, sign it, then tell kup-server to generate an** **identical tarball on the server, verify the signature, and put the compressed** **results in /pub/foolib:**

```
git archive --format=tar --prefix=foolib-1.0/ -o foolib-1.0.tar v1.0
gpg --detach-sign --armor foolib-1.0.tar
kup put --tar --prefix=foolib-1.0/ /repos/foolib.git v1.0 foolib-1.0.tar.asc /pub/foolib/foolib-1.0.tar.gz
```

## AUTHOR

**Written by H. Peter Anvin \<hpa@zytor.com\>.**

## COPYRIGHT

**Copyright © 2011 Intel Corporation**

**This program is free software; you can redistribute it and/or modify** **it under the terms of the GNU General Public License as published by** **the Free Software Foundation, Inc.; either version 2 of the License,** **or (at your option) any later version; incorporated herein by** **reference.  There is NO warranty; not even for MERCHANTABILITY or** **FITNESS FOR A PARTICULAR PURPOSE.**

## SEE ALSO

[**git**(1)](/git/1.md), [**ssh**(1)](/ssh/1.md), [**gzip**(1)](/gzip/1.md), [**bzip2**(1)](/bzip2/1.md), [**xz**(1)](/xz/1.md).
