Go Down

Topic: Problem programming cron tasks in YUN (Read 12218 times) previous topic - next topic


Dec 01, 2013, 06:32 pm Last Edit: Dec 01, 2013, 06:36 pm by NewLine Reason: 1
I have always tried to avoid writing any logs, lock files, etc... on the 'default' location which is typically somewhere in the Linino's memory. I tried to put all those files on the SD-card, just for the reason you mentioned. It would be nice to get confirmation that this indeed the best thing to do to avoid writes on the Linino internal memory.. (note that I am not (yet) using cron)

Roque Campos

I agree with you and I think that this can be a problem. But per default the from output is logged to syslog and I don't, know how change it.

Maybe the solution is to reduce the level of the messages that are logged to the syslog, I don't, know how to do this also.


It would be nice to get confirmation that this indeed the best thing to do to avoid writes on the Linino internal memory.. (note that I am not (yet) using cron)

The less you use the flash, the longer the yun will last. Flash memory has a limited number of writes (I don't know the exact number though: some say 10.000) just as your sd card BUT
1) if the flash of the yun wears out, the yun is gone
2) sd cards are so much bigger and therefore have so many blocks that it's hard to write 10.000 times on each of them

Roque Campos

Yes, I understand you very well. But what I want to explain is that the string that are logged to files like syslog, are logged by default. I mean, it is not my decision: I program a cronjob every minute, and every minute the syslog is writed.

Maybe this behaviour may be disabled by default... or at least, I need to know how to change it.

Hope you understand my not very good English. :~


I think this is an important issue with regards to the lifetime of a Yun.
If the default location where e.g. cron drops its log-file can not be changed, an alternative might be to lock directories for writing?

Roque Campos

I was searching through the internet, and I found the following page:


and the following paragraph:

Syslogd writes the log messages it receives into a file or into the RAM ringbuffer (option -C). The file is a file, it can be accessed with cat, less, vi, etc. The data in the RAM ringbuffer should be accessed with logread. You can of course use pipes, like logread -f | nc 514 or logread -f » /mnt/share/logfile (reasonable on non-flash media, see usb.storage or nfs.client) or pretty much whatever you want.

Then I did a little test with my arduino, turning it off and on, and it is true, all the messages of the syslog are gone. I suppose that this means that the syslog file is not written to the flash memory. It seems that the syslog file is writtent to the ram ringbuffer.

In this case, I understand that there is not a problem having cron jobs wich outputs data to the syslog, because the flash memory is not used.

Am I right?

Thanks in advance.


i hope so, because i have a cronjob every minute  :smiley-eek-blue:


yes don't worry... to be sure run

Code: [Select]
ps | grep syslogd

and you'll find it runs with the -C option...

Go Up