I have tried using crontab, but it is limited to minutes. Is there any other option?
I have also tried something like:
watch -n 1 sh /path-to-script/try.sh
But whenever I close the terminal it stops. I want something which continuously works in the background.
&
at the end of the command and also would read some aboutdisown
andnohup
- see here for details https://unix.stackexchange.com/questions/3886/difference-between-nohup-disown-and – George Vasiliou Dec 13 '17 at 21:15disown
andnohup
. So if I destroy the terminal on which the script is running it will destroy the program as well. @GeorgeVasiliou – Prashant Luhar Dec 13 '17 at 21:28nohup
, no. Usingnohup [command] &
makes the command ignore the terminal's attempts to kill child processes upon the terminal's logout. – Thegs Dec 13 '17 at 22:07