Deleted cron jobs still running on wordpress website - linux

I have created some cron jobs in cpanel and deleted. But some of them are still running.
How can I find where these are stored and delete them?
Can I use Cpanel terminal for this?
Or in which files or database table could they be stored so that I can delete them from there?

With the following command, you can see the list of crons and the items that do not have #(comment) will be executed.
run with the root user or the user you use
crontab -e

if you have access to Cpanel terminal as a non-root user. at first find the pid of your processes and then kill them.
ps -aux | grep ProcessName
for example if your process related to python or java write them.
kill -9 pid
now kill your proccess.
for finding pid of your process also you can use top command and then type c from your keyboard and then find your process.

Please check your WordPress db
Login into PHPMyAdmin and select your WordPress database
The wp_options table record that storages cron data (option_name = ‘cron’) in the database and the cron job has disappeared.
Regards

Related

kthreaddk in postgres uses high cpu

I used Postgres in node.js project but my cpu is 100% in ubuntu server
I used this command
killall -9 kthreaddk
I stopped my project and stop postgresql service, after killing kthreaddk cpu is 0% but after 30 second kthreaddk run again and cpu will be 100% agian
what is khtreaddk and how to stopped it forever?
I try many ways that here is in stackoverflow but I can't solve it
kthreaddk is started by cron job. After it runs, it usually places its code in different directories and keeps updating crontab all the time.
To get rid of it follow these steps:
Identify which user crontab is running it.
$ cd /var/spool/cron/crontabs
# Preview each file here, e.g.
$ cat www-data
* * * * * /run/c8aaf4bea
The /run/c8aaf4bea looks weird, but do not remove it yet...
Block specific user from updating crontab (e.g. www-data). Edit cron.deny file
$ sudo vim /etc/cron.deny
and add a user name
www-data
Now the threaddk process is not able to edit crontab anymore.
Kill all the threaddk processes
$ sudo pkill -9 threaddk
Remove suspected line from the crontab
$ sudo vim /var/spool/cron/crontabs/www-data
* * * * * /run/c8aaf4bea <- remove this line
Remove the user from cron.deny file
It's miner. It use crontab for restart(start) itself.
crontab -u postgres -l
I have similar problem. Just remove job from crontab and restart server imidiatly
I had miner on my vps. My CPU usage was always 100%. First moment i was thinking i have memory leak in my java app or tomcat. I could kill process but it was starting another one in few seconds. In my case it was on user account which i didn't use. I killed all user processes with pkill -u username and then fast deleted user by sudo deluser --remove-home username before miner started its' processes. After this vps worked fine. Maybe it will help someone.

root user of linux spanning lots of processes of python script uncontrollably

I wrote a python script to work with a message queue and the script was launched by crontab. I removed from crontab but the root user of my linux system keeps launching it every 9 minutes.
I've rebooted system and restarted cron but this script keeps getting executed.
Any idea how to keep it from happening?
If you start a cron, service does not stop even if you delete the file in which you have specified the cron.
This link should help:
https://askubuntu.com/questions/313033/how-can-i-see-stop-current-running-crontab-tasks
Also, you can also kill your cron by looking its PId, using: ps -e | grep cron-name, then kill -9 PId

Is crontab detected by ps command?

Hi everyone,
I've got a few scripts running with crontab and I know they are actually running thanks to a log file.
The thing is, each time I type ps -ef | grep .sh (because my scripts are .sh files) i have no results.
I read that crontab was using its own environment to execute his scripts and so I was wondering if ps command was able to detect them.
I'm a newbie to Linux environment, so I'm sorry if my question might seem obvious. Thanks
If you run ps while your script is running, then ps will report that process.
crond is the cron process, and it belongs to root. When crond notices that it's time for your process to run, it will fork a process, change that process's user to your ID, then exec() your script.
This process will appear in ps, if ps is run while it's active, but if the process is short-lived, you only have a short window of opportunity to glimpse it..

kill signal from a underpriviledged user to root user

I have been bangin my head on this problem.
I want to send a kill(pid,SIGUSR1) signal to a process running in root user with a process
running in tom user.However everytime,I do this Operation not permitted comes up.
I searched up the net for any programmatical solution but to no avail.All responses are its impossible.But i am a bit skeptical and think it can be done programatically using c.
I need a sample program or lines which can explain how this can be acheived.
i tried using execl also.
To be more specific this kill signal is generated from mysql user to a process running in root and tried running in mysql aswell returned the same result operation not permitted.
Tom
Have you considered creating a process with an setuid() setting ?
The following is what you'd do from a unix/linux command line. Haven't used c in a while, but I'm pretty sure there's some "system" or "shell" function you can pass a shell command to.
If you can use sudo from your, that should do it:
sudo kill -9
Normally, you'd just need
kill -9
but some processes need more authority to kill.
You can get the process id with
ps -aux | grep
I'm afraid I don't know any more than that, hope this helps!
kyle

How to terminate screen while running a .sh?

I search everyplace but didn't find a solution to my question, please help!
My situation:
I need run a huge .sh in my AWS (amazon web service), it will take about 4-5 hours to finish the job, I don't want to sit down just look those logs, so I create a screen to run it (screen 1), but while I configure the installation, I make a stupid mistake to create another screen and config and execute (screen 2).
The question is:
Screen 2 finish the job and I 'exit' the screen(terminated), but I can't terminate screen 1, because when I enter 'exit', it become a parameter of configuration, CTRL+A+K also din't work, please tell me how can I kill this screen, thanks.
KILL -9 <pid> does the trick. If you want it to run in the background do it for the parent process.
logon to another session.
ps -ef | grep yourusername
will show you the processes running that you own. The leftmost number is the pid of the process.
Issue a kill command on the process you want to stop.
kill [pid]
If that fails try
kill -9 [pid]

Resources