chris8lunch

Well-Known Member
May 27, 2006
160
0
166
How can I set Crons in WHM to do stuff IN WHM, like for example I want WHM to automaticly update system software and server software instead of me having to click the links myself and also "Fix Insecure Permissions (Scripts)"..

Is there a reason why this doesn't already happen? Could it cause problems?

Thanks!
 

chris8lunch

Well-Known Member
May 27, 2006
160
0
166
Thats totally different updates from what I;m talking about. Maybe you didn't read my post clearly, says nothing about updating cPanel/WHM.
 

freedog96150

Well-Known Member
Mar 25, 2005
68
0
156
Nevada, USA
dalem said:
when you upcp it does these ???
What dalem is saying is that the upcp script found in the /scripts directory will take care of the updates you mentioned.

First set your preferences in Server Configuration -> Update Config
Next, go to Addon -> Configure cPanel Cron Times and set the time that is best for your server to run the upcp script.

BTW, the "fix insecure scripts" runs as well from the upcp script.

I urge you to compare the output of running the Software -> Update Server Software and software -> Update system software to the output from /scripts/upcp. You will find that they are identical. Also the same as running cPanel -> Upgrade to latest version.
 

chris8lunch

Well-Known Member
May 27, 2006
160
0
166
I'm not trying to update cpanel automaticly!! Maybe I'm confused, but it doesn't seem like your talking about my problem at all!
 

mohit

Well-Known Member
Jul 12, 2005
553
0
166
Sticky On Internet
you mean ability to add/remove custom crons from WHM

hi chris8lunch,
i think you were looking for an optino which lists your current cron jobs and ability to add/remove custom crons from WHM. Such a feature is not yet available in standard cpanel installation, anybody with a mod might be able to do so, but i didn't found any yet.

see ya,
mohit
 

chris8lunch

Well-Known Member
May 27, 2006
160
0
166
mohit said:
hi chris8lunch,
i think you were looking for an optino which lists your current cron jobs and ability to add/remove custom crons from WHM. Such a feature is not yet available in standard cpanel installation, anybody with a mod might be able to do so, but i didn't found any yet.

see ya,
mohit
Nevermind guys, its so simple but no one is getting it.

Thanks for your help anyway.
 

chris74108

Well-Known Member
Apr 30, 2004
86
0
156
chris8lunch said:
How can I set Crons in WHM to do stuff IN WHM, like for example I want WHM to automaticly update system software and server software instead of me having to click the links myself and also "Fix Insecure Permissions (Scripts)"..

Is there a reason why this doesn't already happen? Could it cause problems?

Thanks!


I was not going to reply to this but since you think the others who posted are crazy I thought I would break this down for you.


1.
How can I set Crons in WHM to do stuff IN WHM,
At this point no one has any clue what your talking about.
Lets keep going
2.
like for example I want WHM to automaticly update system software and server software instead of me having to click the links myself and also "Fix Insecure Permissions (Scripts)"..
Well that sure sounds to me like " I want whm to update every night by itself and I want it to fix insecure permissions. While its at it lets have it update the system software and server software. "

I think this post answered that best
First set your preferences in Server Configuration -> Update Config
Next, go to Addon -> Configure cPanel Cron Times and set the time that is best for your server to run the upcp script.

BTW, the "fix insecure scripts" runs as well from the upcp script.

I urge you to compare the output of running the Software -> Update Server Software and software -> Update system software to the output from /scripts/upcp. You will find that they are identical. Also the same as running cPanel -> Upgrade to latest version.
So what he is saying is that when you go to update config and correctly setup update config it will do everything you asked for. The part about "configure cpanel cron times" is so you can tell your server when to run the cronjob and update your server instead of letting it pick. He also suggests you go to the Cpanel group in whm and upgrade to latest version since this is what the cronjob does and compare the output that it displays in your browser with what you get when you login ssh and type /scripts/upcp
because its the same script.
Should you happen to do this I would recommend waiting until the update in your web browser is complete before running /scripts/upcp
Running both at the same time could give unexpected results.
 

chris8lunch

Well-Known Member
May 27, 2006
160
0
166
chris74108 said:
I was not going to reply to this but since you think the others who posted are crazy I thought I would break this down for you.


1.
At this point no one has any clue what your talking about.
Lets keep going
2.

Well that sure sounds to me like " I want whm to update every night by itself and I want it to fix insecure permissions. While its at it lets have it update the system software and server software. "

I think this post answered that best

So what he is saying is that when you go to update config and correctly setup update config it will do everything you asked for. The part about "configure cpanel cron times" is so you can tell your server when to run the cronjob and update your server instead of letting it pick. He also suggests you go to the Cpanel group in whm and upgrade to latest version since this is what the cronjob does and compare the output that it displays in your browser with what you get when you login ssh and type /scripts/upcp
because its the same script.
Should you happen to do this I would recommend waiting until the update in your web browser is complete before running /scripts/upcp
Running both at the same time could give unexpected results.

Ok, let me be more specific, I'm not stupid, I know how to do these things but I will explain this in the best SIMPLE way that anyone should be able to understand it.

WHM has very useful functions, the functions I am talking about are 3. The first is located here,

I have underlined the feature I am talking about.

Security
Fix Insecure Permissions (Scripts)
Manage SSH Keys
Manage Wheel Group Users
Modify Apache Memory Usage
Quick Security Scan
Scan for Trojan Horses
Shell Fork Bomb Protection
Tweak Security

I would like to set a cron job for this. Is it possible? No, I don't want to set cron jobs to run this and update cPanel. I said NOTHING about that at all.

Lets take a look at the next two features I am talking about.

Again, I have underlined the features I am talking about.

Software
Apache Update
Check/Repair a Perl Script
Install a Perl Module
Install a RPM
Rebuild RPM Database
Update Backend Scripts
Update Server Software
Update System Software

Yet, again, is there a way to set cron jobs for these features?

I am not asking anything else, or less, just as put.

Thanks.:eek:
 

Shrek

Active Member
Sep 6, 2004
43
0
156
Arkansas, USA
You can do these things in Shell. All you have to do is edit the /etc/crontab file.

For the insecure permissions, you would need to find what script it calls and test it in Shell.

For example, I automated a mail permissions script in WHM each day because they sometimes go bad... so after getting in shell (my system is CentOs so we use nano instead of pico or edit), I enter nano /etc/crontab

Then, I add the following line:
00 23 * * * root /scripts/mailperm > /dev/null 2>&1

This runs each day at 12:23am (just after midnight), and the > /dev/null 2>&1 just prevents me from getting a mail from the server each night with its output. If you want to read the output leave that off and only enter this:
00 23 * * * root /scripts/mailperm

I also do this on "locate" to find certain scripts like shell.php ... its in the same area /etc/crontab and I just enter this:
03 33 * * 4 root locate shell.php

This runs the 4th day of each week (Sunday is the 1st day), at 3:33 am and I, of course, want the server the server to send the output to me (which goes to the mail account you have for root mail), so I don't enter the > /dev/null 2>&1 here.

There are many ways you can use this, I even use it to remove mail queue build up each night at midnight.

I believe this is what you are looking for, and I hope it sends you along the right path.
 
Last edited:

Shrek

Active Member
Sep 6, 2004
43
0
156
Arkansas, USA
I did some quick research... what you would want to run is this in your /etc/crontab

00 10 * * * root/scripts/fixsuexeccgiscripts

You can change the 10 or however you want it... but this would run the script you want each night at 10 past midnight and send the output to you........ if it sends output that is.
___________________________________

I had to add this sorry, you cannot do this in WHM though.. you have to have shell access to your server and follow the above guidelines... and if you don't know how you can study up a bit on it. We all start off wet and naked, but learn from there. :)

--------------------------
One more edit .... update server software is /scripts/sysup
update system software is /scripts/rhlupdate
 
Last edited:

chris8lunch

Well-Known Member
May 27, 2006
160
0
166
Thanks, someone who gets it out of all these guys!! Jesus, this forum is (sorry to say) the worse forum for any support! I have LOADS better luck on WHT.:rolleyes:
 

dalem

Well-Known Member
PartnerNOC
Oct 24, 2003
2,983
159
368
SLC
cPanel Access Level
DataCenter Provider
these forums are other like minded admin's who are running cpanel the help you receive is voluntary.
if you are going to insult the posters that try to help you no one is going to help you as I said " the help you receive is voluntary"

quoted by you "I'm not stupid, I know how to do these things" then why are you asking ? no one here will chastise you for not knowing Linux

setting up a crontab is one of the most basic Linux commands but obviously if you are running your Linux box out of WHM then you "don't know how to do these things"
Cpanel/WHM is a tool it des not manage a web server as some would believe.


if you took the time to state your question in plain clear English one time as most of the posters trying to help asked you to do.
If you looked at what each link did when you clicked them you could have answered your own question.

/scripts/rhlupdate (which is depreciated which really runs )
/scripts/rpmup
/scripts/sysup

which as stated in my previous post
you can set both of these in WHM
update config

security Package Updates runs /scripts/rpmup
cPanel Package Updates runs /scripts/sysup


if you would like to do this via a cronjob manually

from the command line SSH (root) and add the following lines example times only
crontab -e

0 1 * * * /scripts/rpmup
0 2 * * * /scripts/sysup


for
Fix Insecure Permissions (Scripts)

is coded into cpanels code and can't be ran via cron ( at least I don't think so )

but this one will work
/scripts/fixsuexeccgiscripts
0 3 * * * /scripts/fixsuexeccgiscripts
 

chris8lunch

Well-Known Member
May 27, 2006
160
0
166
dalem said:
these forums are other like minded admin's who are running cpanel the help you receive is voluntary.
if you are going to insult the posters that try to help you no one is going to help you as I said " the help you receive is voluntary"

quoted by you "I'm not stupid, I know how to do these things" then why are you asking ? no one here will chastise you for not knowing Linux

setting up a crontab is one of the most basic Linux commands but obviously if you are running your Linux box out of WHM then you "don't know how to do these things"
Cpanel/WHM is a tool it des not manage a web server as some would believe.


if you took the time to state your question in plain clear English one time as most of the posters trying to help asked you to do.
If you looked at what each link did when you clicked them you could have answered your own question.

/scripts/rhlupdate (which is depreciated which really runs )
/scripts/rpmup
/scripts/sysup

which as stated in my previous post
you can set both of these in WHM
update config

security Package Updates runs /scripts/rpmup
cPanel Package Updates runs /scripts/sysup


if you would like to do this via a cronjob manually

from the command line SSH (root) and add the following lines example times only
crontab -e

0 1 * * * /scripts/rpmup
0 2 * * * /scripts/sysup


for
Fix Insecure Permissions (Scripts)

is coded into cpanels code and can't be ran via cron ( at least I don't think so )

but this one will work
/scripts/fixsuexeccgiscripts
0 3 * * * /scripts/fixsuexeccgiscripts
Maybe if you spoke better english I would understand what your talking about more clear. Seems WHT has people who understand without me having to go in detail. Its in plain English, theres nothing about it thats not hard to understand. If you knew WHM then you would know what I'm talking about. SSH is different, but now I see thats the only way I can do it.

I wasn't speaking bad or trash about you so I would appreciate it if you wouldn't to me.
 

Shrek

Active Member
Sep 6, 2004
43
0
156
Arkansas, USA
This just IN !!!

If you have WHM Xtra you can edit /etc/crontab (from the 'browser' link), and input all your crons from there.. not using shell at all. :cool:

Thought I'd throw that in.

Another thing, for everyone ............... no need to hammer on anyone. It's all a learning curve, not just for the initial person that asked the question but perhaps later when someone does a search. You can have hundreds of people read the same paragraph and ultimately you WILL get different responses, I just lucked out on this because I knew what you were asking from point one, but decided to take you to the logical step of shell,.......... then thought about it later and realized.... YOU CAN do this in WHM but only if you have WHM Xtra.

That's just my 2 cents.

We are all learning, and should try to do so, each day.
 

chris8lunch

Well-Known Member
May 27, 2006
160
0
166
Shrek said:
This just IN !!!

If you have WHM Xtra you can edit /etc/crontab (from the 'browser' link), and input all your crons from there.. not using shell at all. :cool:

Thought I'd throw that in.

Another thing, for everyone ............... no need to hammer on anyone. It's all a learning curve, not just for the initial person that asked the question but perhaps later when someone does a search. You can have hundreds of people read the same paragraph and ultimately you WILL get different responses, I just lucked out on this because I knew what you were asking from point one, but decided to take you to the logical step of shell,.......... then thought about it later and realized.... YOU CAN do this in WHM but only if you have WHM Xtra.

That's just my 2 cents.

We are all learning, and should try to do so, each day.
Like I said, I know how to in SSH, I wanted to know and clearly asked if it can be done in WHM. No need to blow up on me.

Anyway, thanks for all that helped.