0

have removed jobs from crontab but somehow it's still running at the scheduled time. I am really not sure what to do.

Below I have also removed user crontab with:

sudo crontab -r -u USERNAME
$sudo ls -l /var/spool/cron/
total 4
-rw-------. 1 root root 121 Jan  7 02:28 root

This is user's crontab which is empty:

$crontab -l
$

This is cron log from /var/log (It's not even showing here)

Mar 18 21:01:01 u0101 run-parts(/etc/cron.hourly)[65988]: starting 0anacron
Mar 18 21:01:01 u0101 run-parts(/etc/cron.hourly)[65997]: finished 0anacron
Mar 18 21:10:01 u0101 CROND[66668]: (root) CMD (/usr/lib64/sa/sa1 1 1)
Mar 18 21:20:01 u0101 CROND[67392]: (root) CMD (/usr/lib64/sa/sa1 1 1)
Mar 18 21:30:02 u0101 CROND[68097]: (root) CMD (/usr/lib64/sa/sa1 1 1)
Mar 18 21:30:02 u0101 CROND[68098]: (root) CMD (/root/linux-mem.sh 1>/dev/null 2>&1)
Mar 18 21:40:01 u0101 CROND[68851]: (root) CMD (/usr/lib64/sa/sa1 1 1)
Mar 18 21:50:01 u0101 CROND[69614]: (root) CMD (/usr/lib64/sa/sa1 1 1)

What else to lookout for? should I change my script names? I really cant figure out how to stop the jobs from running?

αғsнιη
  • 40,939
  • 15
  • 71
  • 114
Amin
  • 13
  • 4
  • Why don't you show us that job? – berndbausch Mar 19 '21 at 05:25
  • 05 00 * * 1-7 /home/kile/insertPRD.sh >> /home/kile/Cronlog/Insert.log 2>&1 This was one of the jobs in user crontab, it's been removed & crontab is completely empty...even cronlog is not showing the above script was triggered however, the script is still running. – Amin Mar 19 '21 at 05:55
  • As a matter of now that i give : $ crontab -l no crontab for USER $ And yet still job is running at scheduled time. Its weird. There are no other users scheduling this cron job except me – Amin Mar 19 '21 at 05:58
  • Add `ps -ef` to the insertPRD.sh script to see what might have launched it. – berndbausch Mar 19 '21 at 06:38
  • `ps -ef| grep 'insertPRD' | grep -v color` (nothing came up) still no luck ! I renamed the scripts lets see – Amin Mar 19 '21 at 08:01
  • No. Add `ps` to that script, so that you can see which processes run when the script is launched. – berndbausch Mar 19 '21 at 08:47
  • 2
    How do you know the script is running? – Kusalananda Mar 19 '21 at 10:04
  • The script triggers a mail. – Amin Mar 19 '21 at 10:06
  • @berndbausch sorry i'm not following. – Amin Mar 19 '21 at 10:16
  • Finally FIGURED OUT!!!!!! Our internal team had cloned our server to UAT environment which created a copy of all jobs/crontab etc. Thanks for all the help1 – Amin Mar 19 '21 at 10:45
  • Does this answer your question? [Cron job still running when deleted](https://unix.stackexchange.com/questions/85089/cron-job-still-running-when-deleted) – αғsнιη Mar 22 '21 at 10:33
  • It was helpful i validated everything as said, but in the end it was a cloned server which was triggering my job. I removed the files from there and it stopped. – Amin Mar 22 '21 at 10:39

2 Answers2

0

If you are sure cron isn't running it - have a look if there's a process hanging around, or perhaps some other user has it in cron (needs to be done as root).

Mr R
  • 218
  • 2
  • 8
0

Finally FIGURED OUT!!!!!! Our internal team had cloned our server to UAT environment which created a copy of all jobs/crontab etc. Thanks for all the help.

Amin
  • 13
  • 4