hitrov/oci-arm-host-capacity

Feature Request: Add timestamp in oci.log file

AD2011 opened this issue · 2 comments

As the title suggests, please add the option to log timestamp in the oci.log file

I've just set the script up, and to achieve timestamp in the log I've created a shell script called timestamp.sh
#!/bin/bash
while read x; do
echo -n date +%d/%m/%Y\ %H:%M:%S;
echo -n " ";
echo $x;
done

And then edited my crontab to read as follows:
5 * * * * /usr/bin/php /opt/oci-arm-host-capacity/index.php 2>&1 | /opt/oci-arm-host-capacity/timestamp.sh >> /opt/oci-arm-host-capacity/oci.log

Crude but effective!

Thanks, but it didn't work for me.
A better way is mentioned in #82