U
U
uuuu2020-02-26 15:13:49
linux
uuuu, 2020-02-26 15:13:49

How to run commands from a file in a screen window via cron?

Hello!
Such a task:
(Ubuntu server 18.04)

A console program runs in the screen terminal that executes commands (if you enter them manually and press enter)

There is a file where commands are written, for example

print('Hello')
print('World')

How via cron execute the commands that are in the file in the screen window?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladimir, 2020-02-26
@MechanID

Let's say you have a screen called "myprogramscreen"
send the command "mycommand" there and press enter like this:
screen -p 0 -S myprogramscreen -X eval 'stuff "mycommand"\015' then
make a bash script that will do this and adding it to cron is not difficult.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question