|SokenDev fda6a5f68a||1 year ago|
|README.md||1 year ago|
How to create a looped command in linux, that will run permanently in the background.
You must have a basic understanding of Linux to be able to follow this tutorial. I will not help with basic requests such as "how do I change directory".
touch loop.sh- Creates an empty file called
loop.shin the current directory.
nano loop.sh- Opens the file in the nano editor, feel free to use vim or your other favourite text editor.
#!/bin/bash while true do mycommandhere sleep 1 done
mycommandherewith your command. It may be
python run.pyor something else, but make sure you take into account file paths when specifying where a file is.
/bin/bash loop.sh &>/dev/null &. There are some caveats with this, so here's some links: