Admin user cron jobs?

Kal

Verified User
Joined
Nov 18, 2019
Messages
128
Location
Australia
I've written a little shell script that syncs backups to Amazon S3 storage. Now I want to run it daily. What's the best way to do this using the DA interface? I'd have thought I could set up a cron job from Admin level, but I can't see this option anywhere. If I switch to User level (admin user), there is a Cron Jobs screen under Advanced Features, but it won't let me in. It complains 'There is no default domain; you should start with creating one first' and redirects me to the Create Domain screen. I don't see why the admin user needs a domain. So I guess my questions are:
  1. Should admin user have a 'default domain'? If so, why?
  2. If not, how does the admin user create cron jobs in DirectAdmin?
 
1. Should admin user have a 'default domain'? If so, why?
Not but it might be easy for some things if you're using the hostname domain as default domain, for example of you also use nameservers on it. Which can also be created otherwise. Next to that, it's the only way to give admin an FTP account, easy way to create abuse and postmaster email accounts for the mani mailserver for example.
So it's no need or should, but it can come in handy. Unless you create another admin account to do this, which is also very possible.

2.) He doesn't. Or maybe if you create them via the root acount, not sure about this one. Or if you create another admin account for this purpose.
 
Thanks Richard. I already have an account that uses the hostname domain. It was one of the accounts I brought across from my old cPanel server. It hosts a website, has SFTP access and all the standard mail accounts (abuse, postmaster, etc).

I thought the default admin user was just that—an account for administering the server, not for hosting sites, etc. So I guess this is one aspect of DirectAdmin that I don't really grok. In any case it hasn't troubled me before, as I've never needed to switch to User level for the admin account… until now that is, since that's the only place I can find the option to create cron jobs.

I'd love to hear from the developers on this one… Is this an oversight, that the admin user can't create a cron job from the DirectAdmin UI without setting up a default domain? (I can't see a logical connection here.) Or is it this way by design?
 
Thanks Brent. Good to know there's a way to create a cron job in the shell and get it to show up in DA. I might have to do that for now.

It would be so much simpler though if we could just do it all within DA, and I'm still hoping to hear from the devs about this. (I opened a ticket and referred them to this discussion.)
 
It would be so much simpler though if we could just do it all within DA, and I'm still hoping to hear from the devs about this. (I opened a ticket and referred them to this discussion.)
I don't quite understand the difference. Since you can do this by just going in to userlevel of admin and create the cron job. It's the same.
The option Brent pointed to is for visibility only:
This will allow a cron manually by a User in ssh, to be visible in DA, even if the cron was not added through DA.

With creating via root account I ment via SSH because I don't think of it because we don't have users with SSH access, sorry about that. ;)

I thought the default admin user was just that—an account for administering the server, not for hosting sites, etc. So I guess this is one aspect of DirectAdmin that I don't really grok. In any case it hasn't troubled me before, as I've never needed to switch to User level for the admin account… until now that is, since that's the only place I can find the option to create cron jobs.
What is your issue with this? Except for the root user, as far as I can see it's the same in cPanel. I'm just wondering, nothing more.
You don't need to host a website. You can use the admin user account just for administering the server without hosting sites on it.
That's an option. not an obligation. User level only means that it's used for that user only (in this case admin) and not for the whole server. Resellers also have a reseller level (for administering their users) and user level, for administering their own things (if wanted).
So maybe I'm missing something, but I don't quite understand the problem/difference?
 
Thanks for the report. I'll report the issue to the Evo devs. The back-end itself doesn't need a domain.
For a workaround, you can use the Enhanced skin, and access /CMD_CRON_JOBS directly, as the link to it won't be visible without a domain.

John
 
I don't quite understand the difference. Since you can do this by just going in to userlevel of admin and create the cron job.
The problem is that DA won't let you even access the User level Cron Jobs screen if you haven't set up a domain on the admin account. As I said, I can't see a logical connection between having a domain and creating a cron job—which John has now confirmed.

Thanks for the report. I'll report the issue to the Evo devs. The back-end itself doesn't need a domain.
For a workaround, you can use the Enhanced skin, and access /CMD_CRON_JOBS directly, as the link to it won't be visible without a domain.
Thanks John! (y)
 
Martynas just replied to my ticket to say this is fixed already! I just updated DirectAdmin to 1.61 and can confirm that Admin user now has access to the User level Cron Jobs screen (with or without a domain)! :D

Update: Unfortunately, clicking the Create Cron Job button doesn't work—it brings up the Create Domain screen again. Hopefully they'll address that soon.
 
Last edited:
the Create Domain screen again. Hopefully they'll address that soon.
Yes I have been waiting for that to go away forever... It has been brought up a number of times.
 
The problem is that DA won't let you even access the User level Cron Jobs screen if you haven't set up a domain on the admin account.
Thank you for explaining. But I already have read this. I just wondere why you don't like this, as mostly the domain of the hostname is used, and there are lots of other things to get more easy access to things like phpmyadmin, cron, especially also postmaster and abuse email adresses for the hostname domain (RFC's) which is also a good thing to have and things like that, and all without having the need to setup a website.
Ofcourse if you don't want to use that, it's a choice, but it has benefits of having it present and I don't see any disadvantages yet.
 
mostly the domain of the hostname
In DA \ EVO under admin account, I have never built a domain under the Admin User. I added the account as its own user on the server.

The issue is EVO wants you to have a domain built there in the admin user. Hence the Create Domain screen comes up all the time in Admin. Maybe in enhanced you don't see this or maybe you have a domain built-in admin user?

I have asked before what is the reason to build a domain here in the admin account/user? I asked should I build my main site here. I think it stems from the idea Admin is a reseller and an "Administrative user" in the design of the system. Instead of it just being an "Administrative user" for the system.
 
I just wondere why you don't like this, as mostly the domain of the hostname is used, and there are lots of other things to get more easy access to things like phpmyadmin, cron, especially also postmaster and abuse email adresses for the hostname domain

You made this point before and I replied here. I already use the hostname's domain for other things, and I've been able to do everything I need without a domain on the admin user until now. There's no logical reason why we need a domain to create a cron job and the devs have acknowledged this.

I think it stems from the idea Admin is a reseller and an "Administrative user" in the design of the system. Instead of it just being an "Administrative user" for the system.

Yes, in cPanel you have a very clear separation between server administrator (WHM) and user (cPanel). Don't get me wrong though… I very much prefer the unified interface of DirectAdmin over cPanel. I used cPanel for 13 years and I've used DirectAdmin for just a few months, and I'm already a convert. I don't miss cPanel at all! DirectAdmin just needs to iron out a few creases—this admin user domain thing being one of them.
 
In DA \ EVO under admin account, I have never built a domain under the Admin User. I added the account as its own user on the server.
That's a choice one can make. So you create a hostname like server.somedomain.com and then you create the domain somedomain.com as a simple user? Sorry but I don't see any benefit to that, no reason to do that separately. But it's a choice.

I'm using enhanced level and we -always- use the hostname's domain for the user level on admin. Most easy way to create nameservers and things I mentioned amongst others.
But that's everybody's choice ofcourse.

I asked should I build my main site here. I think it stems from the idea Admin is a reseller and an "Administrative user" in the design of the system. Instead of it just being an "Administrative user" for the system.
That probably is indeed the design of the system. However, the question if you shuold build your main site there can not be answered with just yes or no because that's a choice.
We normally have 2 domains. 1 is the admin domain, which so under user level also has the same domain name as the hostname is from.
The 2nd domain is made as secondary admin and there the main domain is running on and resellers are created from.
Not necessary, but it makes live easier when having to transfer to other servers. On an older server the admin has his main domain under the main admin account.
Since you also should obey RFC's you should have things like a postmaster and abuse email account for the hostname's domain. So that domain has to be used anyway. Either used as admin, reseller, other admin or just user. The only benefit to use it as user is maybe a bit more safety if the password gets hacked.

Could also be I'm missing something. Anyway, it's not a must, but it makes live easyer when the hostnames domain is made, so if you don't plan to run a website on it, why not just use it under admins user level?

CPanel is build a bit different. I don't remember how Plesk has done that.

And no, in Enhanced skin we do not get a message as admin that we need to create an admin domain. At least not until a few weeks ago.
By the way... I stepped back on the reseller account from Evo to Enhanced because I find enhanced easier and quicker and better overview. It's old facient but quick.

You made this point before and I replied here.
Not really. You did not really answer my question about why that would be an issue. So it's different in DA, so you now have an option to switch to user level which you did not have or used before, I didn't understand your problem with that.
As I read it now it's not that it's different from what you're used to but you don't like it because you don't -want- it to work that way. That's something else and that is the answer to my question than.

Yes, in cPanel you have a very clear separation between server administrator (WHM) and user (cPanel).
Which is not a big difference. Same here on DA. A user also logs in to the same port as the admin, but the permissions are totally different.
We've worked with that admin domain thing for many years and also see the benefits of it. So imho maybe they can remove the obligation to create such domain, but please do not remove the option to have one there on user level if wanted.

There's no logical reason why we need a domain to create a cron job and the devs have acknowledged this.
Yes they did, and then I'm very curious again as to why an admin should need a cronjob if he hasn't a domain anyway, seems not logical to me? I don't want to start a discussion about this, I only intent to get one or two examples to kill my curiosity and maybe learn something new.
And also why cron and for example not ftp?

Just to be clear, I'm not saying you should not do things the way you do or have idea's to change things. I'm just very curious as to why the current setup is not working for somebody, what people have against an admin domain from the hostname, even if they don't host the website on it. It's just getting used to as I had to get used to everything working different in Plesk and cP. I'm looking for disadvantage arguments not for "don't like, not used to" arguments, so that's my curiosity.
However, all improvement is good ofcourse, no problem there. ;)
 
So you create a hostname like server.somedomain.com and then you create the domain somedomain.com as a simple user? Sorry but I don't see any benefit to that, no reason to do that separately. But it's a choice.

I do the same thing as Brent, and many, many others. It's a very common way to set up a server. As I explained before, 'It was one of the accounts I brought across from my old cPanel server.' So it's also a legacy thing. In migrating from cPanel to DirectAdmin, I could have opted to register a new domain to do it your way, but I didn't know there might be issues with not having an admin domain in DirectAdmin—why would I anticipate this if it's never been a problem before?

Since you also should obey RFC's you should have things like a postmaster and abuse email account for the hostname's domain.

As I mentioned before, my main domain 'hosts a website, has SFTP access and all the standard mail accounts (abuse, postmaster, etc).' So you can relax on that point—the RFC2142 gods are smiling on my domain.

… you don't like it because you don't -want- it to work that way.

I think that's unfair. I started this post out of a genuine need: to create a simple cron job to schedule a backup script. As the system is currently, I can't create that cron job using the DA interface because of a programming oversight—an arbitrary enforcement of the admin user domain 'option'.

So imho maybe they can remove the obligation to create such domain, but please do not remove the option to have one there on user level if wanted.

No one on this thread has asked for the option to be removed. If you thought that was what I was asking for, you've misunderstood. I have no problem with you creating a domain for your admin user if that works for you. I'm guessing Brent doesn't have a problem with that either. All we're saying is that it shouldn't be enforced when there's no technical requirement for it. Hopefully we can agree on that much and leave it there.

To get back on point, John has just updated my ticket to say 'Thanks for the report. We've confirmed it and reported it to Evo devs. Should have a solution likely sometime tomorrow.' :D (y)
 
So it's also a legacy thing. In migrating from cPanel to DirectAdmin,
Oke I was just wondering if it was not getting used to, because cPanel/whm is logged in as root.
I don't remember cP having an admin user the way DA has it. So it's done totally different. I see this more as getting used to, not yet disadvantage to anything. Administering a server as root or as a DA admin are totally different things because the DA admin is not root and had less permissions.

I think that's unfair. I started this post out of a genuine need: to create a simple cron job to schedule a backup script. As the system is currently, I can't create that cron job using the DA interface because of a programming oversight—an arbitrary enforcement of the admin user domain 'option'.
I'm sorry.😔 I did not want to sound or be unfair in any way. But the only thing I understood was "because it did not was an issue before", but the reason for that was because before you were using another panel and using root user as admin, not admin like it's done here. DA does not do a root user.
So since I still was missing a real argument (like some disadvantage), except for "not used to", I thought the only remaining possibility was "don't like". I seem to have taken the wrong conclusion. Sorry about that.

However, the reason of using a custom backup sript as admin is a good reason. I haven't thought of that, allthough this could have been done via SSH it's ofcourse easier if it's possible to do this via the panel. As said all improvement is good.
Which satisfies my curiosity about the why from the cronjob. Thank you.

All we're saying is that it shouldn't be enforced when there's no technical requirement for it. Hopefully we can agree on that much and leave it there.
Oh I totally agree on that. I indeed misunderstood and thought you want to have that option removed. But you only want the enforcement removed.
As I've read from Brent, this happens in the Evolution skin. I did never encounter this on the enhanced skin which I'm using, so this might be a skin issue.
It would be a good thing to remove the enforcement, ofcourse!

Thank you for posting the answer from John so this issue will be solved on the next update too.
Good catch! (y)
 
No worries Richard—water under the bridge. Glad we finally reached an understanding and can agree on the main point.

Yes, John's answer implies that it's an issue with the Evolution skin. I really like the Evolution design—with the standard layout, not the cPanel imitating Icon Grid—so I'd like to stick with it. (As a side-note, I'm mildly curious what the difference is between 'Icons Grid' and 'Hybrid'. They looked exactly the same when I tried them out. Can any other Evolution users enlighten me on that?)
 
No worries Richard
Kal no worries on Richard or me. He and I both have a great appreciation for each other. Here in the DA community we care about not only DA, each other, but learning something new and different. I call it dialoguing. See we live worlds apart, so it's not like I can just come over and sit and have a Coke and chat. So when you sit down at your computer and type to us.. just imaging we are there down under with you. Just regular 'old' guys talking. Shoot Richard, I just told Kal we are old, dang it all I am sorry..

I'm already a convert.
This is a good thing because so am I.

Kal welcome to the group.
 
Thanks for the warm welcome Brent. Yes, I've already seen that the community has a positive vibe and a collaborative spirit—which I guess is why I feel comfortable asking all my questions—both sensible and silly. I'm a designer and developer, not a full-time web admin (and certainly not a Linux geek) which means I won't know if some of my questions are silly until after I ask them. This one, thankfully, turned out to be sensible, but next time… well, who knows…! 😬

And for the record, you're more than welcome to pop in if for a cuppa/beer/coke if you ever fancy a holiday down under—after this whole virus thing has blown over of course!

I just told Kal we are old, dang it all I am sorry

I suppose this is as good a time as any to confess that my photo was taken a little while ago. The beard has a few more grey hairs these days.
 
Back
Top