cronjob

slibbe

Verified User
Joined
Aug 9, 2010
Messages
9
Hi,

how can I as admin set a cronjob for my users (in the same way as I can schedule backups for my users)?

Regards,

slibbe
 
It may look easy, but when logging is as user admin, the cronjobs link is not shown in the DirectAdmin userpanel.

However, editing the URL adding 'CMD_CRON_JOBS?domain=domains.com' does show the cron-jobs page.
So, it appears that cron is not user-based but domain based. That is rather unconvenient.
 
Last edited:
Say, I want to clean a certain directory for every user on my server once a week.

There must be a convenient way to do this. I definitely am not the first person looking for smart solution to this challenge :confused:
 
- Login as 'admin'
- Show all users
- Click on the user where you need to add the cronjob
- Login as the user (above)
- Cronjobs
- Add the cronjob(s)
 
- Login as 'admin'
- Show all users
- Click on the user where you need to add the cronjob
- Login as the user (above)
- Cronjobs
- Add the cronjob(s)

Yes, that is for one user at a time. Apropiate if you have 3 users, not apropiate if you have 50 or 100.
So the question is, how do I set a particular cronjob for a lot (if not all) users, ie in the same way as you can set user-backups?
 
Well, I seem to have some work-around:
- Login as 'admin' (admin-level)
- click on User 'admin', Login as user (cronjobs link doesn't occur)
- add 'CMD_CRON_JOBS?' to the URL 'http://my.server.com:2222/', thus forming http://my.server.com:2222/CMD_CRON_JOBS?
Now I do get the normal cronjobs-schedule window-pane.

All the script needs to do is read the users I want cronjobbed in a loop, and set the apropiate action(s).

Not extremely elegant, but it will probably work.
 
If you want to do it for all users you probably need to set it up as root through ssh.
 
It may look easy, but when logging is as user admin, the cronjobs link is not shown in the DirectAdmin userpanel.

However, editing the URL adding 'CMD_CRON_JOBS?domain=domains.com' does show the cron-jobs page.
So, it appears that cron is not user-based but domain based. That is rather unconvenient.
I'm not sure what you mean. When I log in as admin (the main systems administrator) and then click on the user level (and then on a domain, if I've got more than one domain under the admin user level), clicking on Cronjobs gets me right to the cronjob page.

If that doesn't work for you, then you should make sure you're using an updated DirectAdmin skin before asking further here; old skins and skins maintained by others may not work, but they can't be supported easily by us.

Or, if I'm misunderstanding you, please clarify.

Thanks.

Jeff
 
Adding a cronjob as admin is not going to affect other users since admin does not have any permissions to run commands on other users.

Say, I want to clean a certain directory for every user on my server once a week.

The user admin cannot do this. The script would have to be run as root.
 
The user admin cannot do this. The script would have to be run as root.

That's one of my worries, true. Logging in as admin in DirectAdmin doesn't inherit the same rights as logging is as root under ssh, since admin and root are not the same user.

What jlasman says is also true: I am not sure that I have the most recent stable DirectAdmin version.

Now, apart from updating the DA-version, I have to figure out where the cronjobs operated by root are located. And since the root-user is not shown in DA, I will probably have to make the scheduler work manually.
 
What jlasman says is also true: I am not sure that I have the most recent stable DirectAdmin version.

I think the main difference is that Jeff has domains under the admin user level and you do not. That is why you both see different things under the user level of admin.

Now, apart from updating the DA-version, I have to figure out where the cronjobs operated by root are located. And since the root-user is not shown in DA, I will probably have to make the scheduler work manually.

You have to do it manually as root through ssh. That is what I have been telling you since my first post.
 
However if you don't know enough to work safely through the root you surely don't know enough to work safely through Webmin, since webmin allows you to do things which will completely break your DirectAdmin configuration.

Jeff
 
Or install Webmin if you are worried about breaking stuff in SSH.

I am not so worried about breaking stuff in SSH. I am just very carefull to make sure I do not break anything in DirectAdmin.

Installing Webmin or whatever other tool just because I wouldn't want to take responsibility for configuring cronjobs is no option.
Also, when using this sort of scripting, especially when lack of experience counts, we will of course test first on a non-production server.
 
Last edited:
Back
Top