The best place to store files you don’t want to lose is under
/data. This directory is mounted from your personal server and the contents is not lost on OS update.
If the files are truly important, you may also want to back them up. You could for example schedule a
rsync to some other machine.
NB: This feature was added in v0.1.7.
Create a file called
/data and make it executable. Make sure it has the correct shebang!
echo '#!/bin/sh' > /data/on_start.sh && chmod +x /data/on_start.sh
Now go ahead and edit this file, adding your custom commands.
Lightning Shell doesn’t support
cron, but your host OS such as Umbrel does. You can edit the crontab using
crontab -e (after you have SSHed into your Umbrel!).
You can then use
lsh_exec_ni.sh to execute Lightning Shell commands from Umbrel’s
cron. If you want the data returned by these commands to be available in Lightning Shell, you just have to save it under
For example, you could do the following:
create a file
echo date,price > /data/btc.csv (in Lightning Shell)
periodically save the bitcoin price to
btc.csv by adding the following to your Umbrel’s crontab
echo `date +"%Y-%m-%d %H:%M"`","`/mnt/data/umbrel/app-data/lightning-shell/data/lsh_exec.sh btc2fiat` >> /mnt/data/umbrel/app-data/lightning-shell/data/btc.csv
view the file using
csview in Lightning Shell
These scripts can be used to execute Lightning Shell commands from Umbrel. For example you can run
suez from Umbrel using the following:
The difference between the two is that
-it to Docker while
lsh_exec_ni.sh does not. The latter is to be used from
cron scripts, for example.