csp_helper(1)
π NAME π
csp_helper β a lil collection of caspar helper scripts. bestie, it's a whole toolbox π§°β¨
πΈ SYNOPSIS πΈ
csp_install dir (directory) file (file)
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 π«Ά
okay so listen. The scripts csp_install, csp_mkdircp, csp_scp_keep_mode and csp_sucp are helpers for caspar(7). They're not really the kind of thing you call with your own two hands β most of the time they get invoked by a Makefile that's using caspar. If you wanna know how to hook csp_install, csp_scp_keep_mode and csp_sucp up to caspar, go read the notes on csp_PUSH in caspar(7). iykyk π
π install DESCRIPTION π
csp_install makes the directory you need (only if it's not there already, no drama) and then installs the file, preserving timestamps. Under the hood it's using install(1). periodt.
β¨ install EXAMPLES β¨
csp_INSTALL_OPTIONS='--owner=www-data --group=www-data' \
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 is obsessed with two env vars: csp_INSTALL_OPTIONS and csp_INSTALL_MODE. and if you don't tell it otherwise, the default mode is u=rw,go=r. so generous of it π
π mkdircp DESCRIPTION π
csp_mkdircp calls mkdir(1) and cp(1). You use it the same way you'd use csp_CP. Reach for csp_mkdircp when you keep having to bootstrap an install on a fresh system where the directories you need justβ¦ don't exist yet π. csp_mkdircp makes sure the target directory is actually there before it calls cp(1), by running mkdir -p first. no cap, it just handles it for you π«Ά
π¦ scp_keep_mode DESCRIPTION π¦
csp_scp_keep_mode uses ssh to copy a file over to a remote host, and it keeps the file's permission mode. The lil trick it pulls off is a combo of mktemp(1) and mv(1). Super handy if you want to be sure a file lands installed, like, group writable, without sitting there fiddling with permission bits on the remote host. iconic behaviour, honestly π
πΈ scp_keep_mode EXAMPLE πΈ
chmod g+w rc
csp_scp_keep_mode root@gandalf /etc/uruk rc
π« scp_keep_mode ENVIRONMENT π«
csp_scp_keep_mode honors csp_SSH β and if you don't set it, it just defaults to "ssh". easy π
π₯ sucp DESCRIPTION π₯
csp_sucp calls tar(1) from within sudo(1) from within ssh(1). The way that works out is: it lets you copy files to accounts on hosts you can only reach by calling sudo on the ssh-reachable remote host. so many layers, so much main character energy π§
Typically you're trying to install a root-owned file, but you do not want to just open up the root account to ssh directly. So usually sudo gets used as an extra line of defense. smart, honestly.
β οΈ NB: if your sudo prompts you for a password, bestie you GOTTA have this line in your sudoers file:
Defaults !tty_tickets
Here's why: it first calls sudo -v, and then it calls sudo again to write the data. Since we're using ssh to get to the host, we end up on a different tty for both of those sudo calls. so yeah, that line is not optional π
β sucp EXAMPLES β
Some examples:
csp_sucp rms@bilbo /etc fstab
csp_sucp monty-python commit/ trailer.txt
π AUTHOR π
Joost van Baal-IliΔ
π SEE ALSO π
caspar(7) β and heads up, the caspar homepage lives at http://mdcc.cx/caspar/ . go check it out π¦
okay bestie that's the whole page π this was csp_helper, version 20220907, dated 7 ΡΠ΅ΠΏ 2022, and it comes to you from the USER COMMANDS section of the manual. mwah, go install something cute πβ¨π
π¦ 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