Is it possible to launch a command or Bash script exit terminal and NOT interrupt command?
My solution was to run cron at a specific time of day, but I'm sure there is something easier.
Is it possible to launch a command or Bash script exit terminal and NOT interrupt command?
My solution was to run cron at a specific time of day, but I'm sure there is something easier.
To avoid exit signals propagating to child processes of the terminal and shell, run the command with nohup, i.e.:
nohup cmd &
To ignore all program output and avoid the nohup.out file, you can redirect stdout and stderr to /dev/null like this (with bash):
nohup cmd &> /dev/null &
If you want to run a specific command or file every second or so in the background after exiting the terminal you could try this easy little thing;
nohup watch -n5 'bash script.sh' &
That would run scipt.sh every 5 seconds.