I have a custom command line program that I need to automatically execute after the system has (re)booted. The program
a) outputs text that I need to capture, either in a file or connecting to the process and see the output live.
b) the program writes some files to store captured data (multiple files) while the program is running.
I tried systemd but as I later found process running in a system daemon cannot capture the command line output in a file. I tried rc.local which can capture the output in a file with 2>&1 | tee output.txt but the program isn't able to write files. I also tried crontab but somehow it doesn't start at boot. Maybe CentOS 5 doesn't support it. What other options do I have?
a) outputs text that I need to capture, either in a file or connecting to the process and see the output live.
b) the program writes some files to store captured data (multiple files) while the program is running.
I tried systemd but as I later found process running in a system daemon cannot capture the command line output in a file. I tried rc.local which can capture the output in a file with 2>&1 | tee output.txt but the program isn't able to write files. I also tried crontab but somehow it doesn't start at boot. Maybe CentOS 5 doesn't support it. What other options do I have?
Last edited: