i'm running a program and it should keep running 24/7, and ofc i'm saving its outputs in a log file
"programName > logfile"
the thing is, when i try to delete its content and not the file itself since the program is using it. i can't find a way to clean it up, i used:
cat /dev/null > "logfile" echo "" > "logfile" > log file :> logfile trancate "logfile" -s 0
none of them works, i know about the logrotate but i'm trying to avoid downloading or using any other package beside the one already exist.
i think, the program is writing its output in a buffer and then write it back in the file, so i need to empty that buffer first.
hope you can help me with this.