csp_helper(1)
π csp_helper β a whole lil squad of caspar helpers π
okay bestie, gather round, because this is the csp_helper page from USER COMMANDS and it's literally a friend group of scripts that all exist to make caspar(7) do its thing. no cap. π¦
β¨ NAME β¨
csp_helper β a collection of caspar helper scripts π
β¨ SYNOPSIS β¨
csp_mkdircp dir (directory) file (file)
csp_scp_keep_mode h ([user@]host) dir (directory) file (file)
csp_sucp h ([user@]host) dir (directory) file (file)
β¨ DESCRIPTION β¨
so the squad is: csp_install, csp_mkdircp, csp_scp_keep_mode and csp_sucp. they're all helpers for caspar(7). π
and here's the tea: you typically do not call these directly, bestie. they get invoked via a Makefile that uses caspar. if you wanna know how to link csp_install, csp_scp_keep_mode and csp_sucp to caspar, go read the notes on csp_PUSH in caspar(7). iykyk. π
β¨ install DESCRIPTION β¨
csp_install creates the required directory (if it's needed, like, no drama) and installs the file, preserving timestamps. it does this by using install(1). iconic behaviour fr fr. πΈ
β¨ install EXAMPLES β¨
csp_INSTALL_MODE=ugo=r \
csp_install /srv/www index.html
csp_INSTALL_MODE=u=rwx,go= csp_install /usr/local/sbin mkpasswd
ate. π
β¨ install ENVIRONMENT β¨
csp_install honors these two cuties:
csp_INSTALL_OPTIONSβ extra options, passed along π«Άcsp_INSTALL_MODEβ the mode, and the default isu=rw,go=rβ¨
β¨ mkdircp DESCRIPTION β¨
csp_mkdircp calls mkdir(1) and cp(1). you use it like csp_CP.
use csp_mkdircp if you frequently have to bootstrap installation on a fresh system, like, one where the needed directories don't exist yet π. csp_mkdircp makes sure the target directory exists before calling cp(1), by calling mkdir -p first. main character energy: it just handles it. π
β¨ scp_keep_mode DESCRIPTION β¨
csp_scp_keep_mode uses ssh to copy a file to a remote host, and it keeps the file's permission mode. the trick it pulls is a combination of mktemp(1) and mv(1). π§
super useful if you'd like to be sure a file gets installed e.g. group writable, without fiddling with permission bits on the remote host. no more manual bit-wrangling, we love to see it. π₯
β¨ scp_keep_mode EXAMPLE β¨
csp_scp_keep_mode root@gandalf /etc/uruk rc
β¨ scp_keep_mode ENVIRONMENT β¨
csp_SSHβ the ssh command it honors. default issshπ
β¨ sucp DESCRIPTION β¨
csp_sucp calls tar(1) from within sudo(1) from within ssh(1). yes, that's three layers deep, it's giving inception π. this lets you copy files to accounts on hosts you can only reach by calling sudo on the ssh-reachable remote host.
typically, you wanna install a root-owned file, but you do not wanna allow access to the root account directly from ssh. typically sudo is used as an extra line of defense. π‘οΈ
NB: if your sudo prompts for a password, be sure to have the line
Defaults !tty_tickets
in yoursudoersfile: we first callsudo -v, then we callsudoto write the data. since we usesshto get to the host, we'll use a different tty for bothsudocalls. so yeah, that line is not optional, bestie, don't skip it π
β¨ sucp EXAMPLES β¨
some examples:
csp_sucp rms@bilbo /etc fstab
csp_sucp monty-python commit/ trailer.txt
slay. β¨
β¨ AUTHOR β¨
Joost van Baal-IliΔ π
β¨ SEE ALSO β¨
caspar(7) β and btw the caspar homepage is at http://mdcc.cx/caspar/ . π
and that's the whole page, bestie π this was csp_helper, version csp_helper 20220907, dated 7 ΡΠ΅ΠΏ 2022. go forth and install your files with impeccable vibes πβ¨π¦
π¦ where this page comes from
- debian bookworm: caspar 20220907-1 Β· GPL-3.0-or-later
- ubuntu noble: caspar 20220907-1 Β· GPL-3.0-or-later
- Copyright (c) 2022 Joost van Baal-IliΔ
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms