It is necessary to add to cron a task that will execute a script containing a large number of outputs in stdout. In this case, you need to implement two such things:
- Conclusions in the stdout script must be written to the file (including the error with which the script falls out). At the same time, this log file must be cleaned each time before performing the task. Those. contain only the log of the last completed task.
- It should be possible to see the current output in stdout of the currently executing task. Of course, there can be several tasks at once. And they all run on a remote server. And now you need to be able to connect to the server, see what tasks are being performed at the moment. And right in the live mode, I want to see the current stdout of the currently running task.
tail -fis not an option? - nobodytailwhat you need. Thank.> /var/log/tut_imya_loga.log 2>&1will rewrite the file each time or write to the end? - leaf