Bugfixes, made it work via crontab

Made some changes so that the program works via crontab. Made a new
function that checks file length of two files, error.log and
running_output.txt.