I don't understand what I'm doing wrong. I have two scripts, wich I want to run. One of them at startup, and one of them once per day. I writed the following in scheduled tasks using the luci console:
It does not work, and the only error messages that I can see are in the system log:
Nov 21 12:37:01 Arduino cron.err crond[1523]: user root: parse error at @reboot
Nov 21 12:37:01 Arduino cron.err crond[1523]: user root: parse error at root
Nov 21 12:37:01 Arduino cron.err crond[1523]: user root: parse error at /mnt/sd/rhc/start.sh
Nov 21 12:37:01 Arduino cron.err crond[1523]: user root: parse error at 2>&1
Nov 21 12:37:01 Arduino cron.err crond[1523]: user root: parse error at >>
Nov 21 12:37:01 Arduino cron.err crond[1523]: user root: parse error at 37
Have you tried to enable cron first?
According to superuser.com one has to for OpenWrt:
By default OpenWrt does not enable the cron service. To start it and enable automatic startup during subsequent reboots, you need to execute the following commands:
I'm not sure it's the correct way to call it, but OpenWRT (as well as many linux distros) is "init" based, meaning it starts services (so called "daemons") with "init scripts"
That gives you two correct ways to do something at boot time. Modify /etc/rc.local adding your scripts (easiest and quickest way) or adding an init script. Init scripts are usefull only if you need something to run BEFORE something else. That's the case for SSL and GPG key regenaration, for example.
I suggest rc.local: it's easy and it's the LAST thing to run when your yun starts up
2> is actually redirecting only the STDERR (standard error) stream, not the STDOUT.
Are you trying to redirect the output of the commands you put in the crontab or the log of the cron daemon?
My intention was to redirect the ouput of the daemon to a log script in another location but I can live without it. Instead, I redirected the output of the scripts that are called by the cron. It is more or less the same thing.
But I have a curiosity. I have a cron job every minute. Then, every minute a string like that
Dec 1 16:58:01 Arduino cron.info crond[30828]: crond: USER root pid 4605 cmd /mnt/sd/rhc/historical_1m.sh
is wroted in the system log. Maybe I'm confused, but, it is dangerous to abuse of the log scripts in the linino memory? I mean, I have read that it is not recommended to use the internal storage of the Linino because of the limited number of writes...
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)
NewLine:
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
if the flash of the yun wears out, the yun is gone
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
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.
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?