× NETGEAR will be terminating ReadyCLOUD service by July 1st, 2023. For more details click here.
Orbi WiFi 7 RBE973
Reply

Setting up cron jobs on OS6

Newsat11
Luminary

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...thus the post. Can anyone tell me if the OS6 supports cron jobs through the web interface? If not, will I be able to set the up through SSH in a typical fashion, or will I need some kind of alterations? Any help would be greatly appreciated.

Message 1 of 7
mdgm-ntgr
NETGEAR Employee Retired

Re: Setting up cron jobs on OS6

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.
Message 2 of 7
Newsat11
Luminary

Re: Setting up cron jobs on OS6

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.

Message 3 of 7
mdgm-ntgr
NETGEAR Employee Retired

Re: Setting up cron jobs on OS6

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.

Message 4 of 7
Dewdman42
Virtuoso

Re: Setting up cron jobs on OS6

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?

 

Message 5 of 7
Newsat11
Luminary

Re: Setting up cron jobs on OS6

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.

Message 6 of 7
Dewdman42
Virtuoso

Re: Setting up cron jobs on OS6

I was under the impression /etc/cron.d is handled differently then crontab.

The jobs I put there are not running
Message 7 of 7
Top Contributors
Discussion stats
  • 6 replies
  • 5133 views
  • 0 kudos
  • 3 in conversation
Announcements