csp_helper(1)
π csp_helper β a whole lil fam of caspar helper scripts π
okay bestie, welcome to csp_helper(1), a USER COMMANDS moment. this is the group chat of scripts that make caspar(7) deployments go absolutely off. 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 like, these scripts are not the type to show up to the party uninvited: they typically aren't invoked directly, they get pulled in via a Makefile that uses caspar. π«Ά
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). that's where the lore lives. π
π§ install DESCRIPTION π§
csp_install makes the required directory (only if it's needed, obvi) and installs the file, preserving timestamps β the timestamps stay untouched, periodt. it does all this by using install(1). iconic behaviour honestly. β¨
π 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
π install ENVIRONMENT π
csp_INSTALL_OPTIONSβcsp_installhonors this one π«‘csp_INSTALL_MODEβcsp_installhonors this one too, and the default isu=rw,go=rβ¨
π mkdircp DESCRIPTION π
csp_mkdircp calls mkdir(1) and cp(1). you use it exactly like csp_CP. π
lowkey the moment for csp_mkdircp is when you keep having to bootstrap installation on a fresh system where the directories you need just... don't exist yet. π csp_mkdircp makes sure the target directory exists before it calls cp(1), by calling mkdir -p first. so organized. so thoughtful. main character energy fr fr. π
π scp_keep_mode DESCRIPTION π
csp_scp_keep_mode uses ssh to copy a file over to a remote host, keeping its file permission mode β yes, the mode survives the trip, that's the whole point. π
the trick it pulls is a combination of mktemp(1) and mv(1). and bestie, it's so useful if you want to be sure a file gets installed e.g. group writable, without you sitting there fiddling with permission bits on the remote host. not me doing remote chmod gymnastics β couldn't be me. π
β scp_keep_mode EXAMPLE β
csp_scp_keep_mode root@gandalf /etc/uruk rc
π scp_keep_mode ENVIRONMENT π
csp_SSHβcsp_scp_keep_modehonors this one, and it's"ssh"by default π«Ά
π₯ sucp DESCRIPTION π₯
csp_sucp calls tar(1) from within sudo(1) from within ssh(1). yes, 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. so typically sudo gets used as an extra line of defense. π‘οΈ
NB: if your sudo prompts for a password, be sure to have the line
in yoursudoersfile β because we first callsudo -v, then we callsudoto write the data. and since we usesshto get to the host, we'll end up using a different tty for both sudo calls. so yeah, don't skip that line, bestie. π
πΈ sucp EXAMPLES πΈ
some examples for u:
csp_sucp monty-python commit/ trailer.txt
π AUTHOR π
Joost van Baal-IliΔ
π«Ά SEE ALSO π«Ά
caspar(7)β and the caspar homepage is athttp://mdcc.cx/caspar/π
and that's the whole page, bestie!! β¨ this was csp_helper from csp_helper 20220907, dated 7 ΡΠ΅ΠΏ 2022, hanging out in section 1 of your friendly neighbourhood manual. go forth and install things. slay. π
ππ¦
π¦ 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