i have an understanding problem i hope you can help me with.
i did a small cron script to get info out of a log file every 15 min and wrote it into antoher file with a timestamp.
so i opened the crontab -e
1) The little script works perfect when i start it from commando line.
Starting the script with cron on the other hand i just pasts an empty line to logres.date.
What is the reason for that? some kind of permission problems?
I started the crontab for root.
2) When i extracted all the info from the log file i would like to get rid of the content. How can this be done without actually deleting the file.
My (bad) solution is rm and touch which leads to a problem. after that it gets no more entries until reboot.
could you please when you have time explain in few words what goes wrong and why?
learning about linux and always looking for answers.
echo /var/log/syslog | grep ....... | cut ..... > logres.ret
Are you sure you don't want:
cat /var/log/syslog | grep ....... | cut ..... >> logres.ret
|All times are GMT -5. The time now is 09:02 PM.|