Hi,
I am programming a Western Digital ShareSpace network disk system.
I installed a cron from ipkg. (explained here: ShareSpace - Hacking WD MyBook World Ed ShareSpace - Hacking WD MyBook World Ed)
Cron runs:
/etc $ ps -fe | grep cron
6082 root 616 S < /opt/sbin/cron
18635 root 504 R < grep cron
I have programmed a crontab with a logfile.
The cron does not read my crontab file since the log file does not show a trace of cron.
Is there a way to know which crontab file uses cron? (Where does cron points to?)
First off, your user needs to be in the cron group. Add them to the group like this:
usermod -a -G cron username
You must logout and log back into username for the new group to take effect.
Next let's prove that cron is operating properly. Run crontab -e to enter an interactive editor for your cron table.
* * * * * touch /home/username/filename
If cron is working, cron will create the file /home/username/filename and update its timestamp every minute.
See man 5 crontab for further details on how cron entries should be formatted.
If this works, but your logfile thing doesn't, please provide further details on what you're actually doing, i.e. your crontab entries and script files, otherwise we're just guessing.
---------- Post updated 17-01-11 at 08:59 AM ---------- Previous update was 16-01-11 at 09:42 PM ----------
Well it does not work.
The system is a Western Digital ShareSpace network disk with a Linux OS on it. I have already done that work on another WD MyBook disk and I had no problem.
First usermod is not found, I could have install it with ipkg but it is not available.
Then as I work as 'root' I would suspect root is in the cron group.
The cron process is /opt/sbin/cron.
With 'strings' command I find that the crontab is /opt/etc/crontab
The crontab reads:
The prefered -- at least by this sysadmin -- method for updating a table is to use the man crontab (linux) command. Not only does it handle allthe pesky notification tasks, it does validate the syntax of the entries.
With regards to your cron problem - is crond running? The logfile is /var/log/cron, as mentioned in man crond (linux). There are also other configuration files mentioned in man crontab (linux).
Please try my suggestions the actual way I suggested doing them before declaring that cron isn't working. You're supposed to use the crontab command, not edit files by hand! This will allow it to warn cron that the table's changing, as well as potentially warn you if you have any syntax errors in your crontab that'd prevent it from running.
There may well be additional problems preventing cron from running your script, so I'd also recommend sticking to the 'touch' command until you get that working. One problem at a time. Try calling touch with the absolute path, whatever it may be for your system.
What is your system, anyway? Last time I used ipkg, it was on a wireless router...
No crond is nt running, only cron.
I am quite new to this, I do not know the diff between cron and crond.
$ ps -fe | grep cron
741 root 608 S /opt/sbin/cron
18436 root 504 R grep cron
In the log I have this
$ ls -la /var/log/cron/
drwx------ 3 root root 1024 Jan 14 15:13 .
drwxrwxrwt 4 root root 1024 Jan 17 11:50 ..
drwx------ 2 root root 1024 Jan 14 15:13 crontabs
cd /var/log/cron/crontabs/
$ ls -la
drwx------ 2 root root 1024 Jan 14 15:13 .
drwx------ 3 root root 1024 Jan 14 15:13 ..
---------- Post updated at 05:52 PM ---------- Previous update was at 05:44 PM ----------
My system is a Western Digital 4 disks RAID1 ShareSpace.
It runs Linux.
I am programming a ssh backup system, I also have problem with the rsync public private key stuff.
There is a link to this :mybookworld.wikidot.com/sharespace
I did what they said but since I am stuck with this cron issue.
Thanks Corona688.
yes I use crontab -e
there is no cron group available here since usermod is not on the system, neither in ipkg.
Is there a way to check this group permission by hand?
Yes, the method I suggested earlier, checking the contents of the /etc/group file. It is a text file, so it may be possible to edit it manually, if you're very, very careful.
Hmf... You don't even have a cron group, which makes this awkward. Most of the suggestions I'd make wouldn't apply to your embedded system. Maybe it's not even supposed to have user cron tables.
You could try editing the global /etc/crontab instead of the user ones. Note that its syntax is slightly different than the usual crontab, it takes the usual five time parameters, then the user, then the command, like so:
If you have to create the file, be sure to chmod 644 it after, some crons are very picky about what permissions it wants. And you may have to restart the system for it to start using it.
I finally found an error in the log file;
But I don't really know what it means, so I show you the files:
It seems the error in in ssh , not cron.
So I should open a new thread, should not I?
The other problem is that I dont find /home/filename !!!!
I repeat: /etc/crontab has a different syntax than the user crontab. There's one more field, after the time fields -- the username to run the program under. Since you forgot the username, you're not telling it to run 'touch filename', you're telling it to run 'filename' under the user 'touch'!
I think you should run touch /tmp/filename anyway. /home/ might be in internal flash ROM for an embedded system, and you don't want to overwrite internal flash any more than you have to -- it's got a way more limited number of write cycles than your average USB flash drive. But /tmp/ is probably a ramdisk.