Does anyone know how to truncate both the Macrodroid User Log file -and- the Macrodroid System Log file? Don't these files grow unbounded (size is limitless)? It would be nice to keep the last several days of log entries.
If there is no built-in Macrodroid log truncation then I suspect I might be able to write a Macrodroid shell script (see below) to save the last 500 lines, but I don't know where the Macrodroid log files are or what the filenames are. In short, I guess all I need to know is where the Macrodroid log files are (the PATH or directory) and what the filenames are. I will run this shell script like once every 2 months.
The following is the Macrodroid (abbreviated MD) shell script I intend to use to truncate the Macrodroid log files :
# Set following variable to the FULL directory PATH containing the MD User Log file :
MD_User_Log_Path=/path_to_MD_User_Log_file
# Set following variable to the MD User Log file name :
MD_User_Log_File=MD_User_Log_file
cd $MD_User_Log_Path
# Save current User Log file for later reference : (Will be overwritten next time this routine is ran)
cp -f $MD_User_Log_File $MD_User_Log_File.saved
# Copy last 500 lines of saved User Log back into current User Log file :
cat $MD_User_Log_File.saved | tail 500 > $MD_User_Log_File
# Set following variable to the FULL directory PATH containing the MD System Log file :
MD_System_Log_Path=/path_to_MD_System_Log_file
# Set following variable to the MD System Log file name :
MD_System_Log_File=MD_System_Log_file
cd $MD_System_Log_Path
# Save current System Log file for later reference : (Will be overwritten next time this routine is ran)
cp -f $MD_System_Log_File $MD_System_Log_File.saved
# Copy last 500 lines of saved System Log back into current System Log file :
cat $MD_System_Log_File.saved | tail 500 > $MD_System_Log_File
If the concept of my script is sound, then all I need to do is replace the bold-italicized text (in the following shell script variables) with the actual values :
MD_User_Log_Path=/path_to_MD_User_Log_file
MD_User_Log_File=MD_User_Log_file
MD_System_Log_Path=/path_to_MD_System_Log_file
MD_System_Log_File=MD_System_Log_file
Thanks in advance!
If there is no built-in Macrodroid log truncation then I suspect I might be able to write a Macrodroid shell script (see below) to save the last 500 lines, but I don't know where the Macrodroid log files are or what the filenames are. In short, I guess all I need to know is where the Macrodroid log files are (the PATH or directory) and what the filenames are. I will run this shell script like once every 2 months.
The following is the Macrodroid (abbreviated MD) shell script I intend to use to truncate the Macrodroid log files :
# Set following variable to the FULL directory PATH containing the MD User Log file :
MD_User_Log_Path=/path_to_MD_User_Log_file
# Set following variable to the MD User Log file name :
MD_User_Log_File=MD_User_Log_file
cd $MD_User_Log_Path
# Save current User Log file for later reference : (Will be overwritten next time this routine is ran)
cp -f $MD_User_Log_File $MD_User_Log_File.saved
# Copy last 500 lines of saved User Log back into current User Log file :
cat $MD_User_Log_File.saved | tail 500 > $MD_User_Log_File
# Set following variable to the FULL directory PATH containing the MD System Log file :
MD_System_Log_Path=/path_to_MD_System_Log_file
# Set following variable to the MD System Log file name :
MD_System_Log_File=MD_System_Log_file
cd $MD_System_Log_Path
# Save current System Log file for later reference : (Will be overwritten next time this routine is ran)
cp -f $MD_System_Log_File $MD_System_Log_File.saved
# Copy last 500 lines of saved System Log back into current System Log file :
cat $MD_System_Log_File.saved | tail 500 > $MD_System_Log_File
If the concept of my script is sound, then all I need to do is replace the bold-italicized text (in the following shell script variables) with the actual values :
MD_User_Log_Path=/path_to_MD_User_Log_file
MD_User_Log_File=MD_User_Log_file
MD_System_Log_Path=/path_to_MD_System_Log_file
MD_System_Log_File=MD_System_Log_file
Thanks in advance!