Today I Learned

🍌 Giant Monkeys Learning

1 post by teymourtaghavi

One-liner to run a script via systemd-run

systemd-run --user --unit some-script --collect ~/some-script.sh

Handy if you need to run a long running script but don't want to use screen/tmux. And also doesn't require a running SSH connection.

--collect does an auto-cleanup once the script is finished.

Use the default systemctl / journalctl tools to check it's state and logs.