NETGEAR is aware of a growing number of phone and online scams. To learn how to stay safe click here.
Forum Discussion
Newsat11
Apr 24, 2016Luminary
Setting up cron jobs on OS6
I am looking for help setting up a cron job on OS6. I am using Moodle, which requires a cron job to keep it running effeciently, and i do not feel like logging in everyday to run the command manually...
mdgm-ntgr
Apr 26, 2016NETGEAR Employee Retired
You would need to use SSH for this.
systemd timers are preferable to cron jobs though you can setup cron jobs using SSH. Consider the warning about enabling SSH access before you enable it.
Newsat11
Apr 26, 2016Luminary
Thanks for the help. I have been using SSH for a while, so it is a little late to worry about SSH. I installed some third party software that required me to change permissions and ownership on certain directories. Can you give me more information on systemd timers? Moodle provides a particular cron job via CLI, and I don't know enough about timers to now how it translates.
- mdgm-ntgrApr 27, 2016NETGEAR Employee Retired
There is lots of info available if you search for it in a search engine and you can also see some timers already running on the NAS.
- Dewdman42Jun 03, 2016Virtuoso
I have a quick question about this. I am liking systemd in general and am more than happy to schedule my nightly maintainence as systemd rather then cron....
That being said...
I initially tried to create a cron job using /etc/cron.d/ It doesn't seem to work at all. I see other cron jobs in that dir and my concern now is whether they are also possibly not running as well. My cron.d currently has the following jobs:
cleanhidden frontview-volumeschedule gobackup php5 poweroff
cleanhidden and gobackup are mine, but they don't seem to be running ever. The others were installed either by readynas or some addon perhaps, and I have no idea whether they are also not running.
Can anyone comment about whether its ok and normal for cron.d to be used and if so, why might my own cron jobs not be running?
Here is the contents of one of them:
5 * * * * root /home/me/Bin/cleanhidden
I'm gonna probably switch my own jobs over to systemd per the suggestion on this thread, but this is more of a general question about cron.d, especially since it appears that some other system or addon software may be relying on it?
- Newsat11Jun 05, 2016Luminary
If there are Cron jobs listed in your tab, they are more than likely running properly. If you did not add these jobs, they were probably added by other applications and are running with admin priveledges, under the admin username. The easiest way to add a Cron job is using SSH and entering the command:
$ crontab -e
Note these jobs will be run as the apache server, and are not designated to a specific user. You'll have to know how to use vi, or install a text editor you are familiar with and type the information for your new job. When adding a new Cron job, it will automatically be added as the user logged into SSH (root, unless you enabled SSH for other users). If you want the command to be run under a different user, you need to specify it when entering the new job.
I don't know much about systemd timers, so I can't comment on the difference, but most of the applications I am installing recommend using Cron, so I use it...
If your Cron jobs are not running, the authorized user may not match the application's permissions, therefore, they would not run correctly because they would not be authorized for read/write priveledges on the applications files. Setting them up to run as the server usually bypasses these problems, but you need to know who is the owner of the application files (all Netgear apps run as admin). Good Luck.
Related Content
NETGEAR Academy

Boost your skills with the Netgear Academy - Get trained, certified and stay ahead with the latest Netgear technology!
Join Us!