1

I have a cron job in machine 1 that opens/close machine 2 for a few hours.

Now i deleted all cron jobs in machine 1, so it wont open/close machine 2.

I have no crons,

To delete all crons in machine 1. I used:

sudo crontab -r

but for some reason the machine 2 continue to open/close

I even used to check cron log on machine 1:

sudo cat /var/log/cron

I do NOT see the stop/start commands there at the log. So it seems cron jobs does NOT open/shut machine 2.

Cron job was a root.

When executing the following commands:

sudo crontab -l and crontab -l

They give me: "no crontab for root" and "no crontab for centos" .

Executing the command:

sudo ls -l /var/spool/cron/

returns Total 0

/etc/crontab contains:

SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root

# For details see man 4 crontabs

# Example of job definition:
# .---------------- minute (0 - 59)
# |  .------------- hour (0 - 23)
# |  |  .---------- day of month (1 - 31)
# |  |  |  .------- month (1 - 12) OR jan,feb,mar,apr ...
# |  |  |  |  .---- day of week (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat
# |  |  |  |  |
# *  *  *  *  * user-name  command to be executed

Doing ls cron* inside etc folder shows:

cron.deny  crontab

cron.d:
0hourly
cron.daily:
logrotate  man-db.cron
cron.hourly:
0anacron
cron.monthly:
cron.weekly:

Previously it was a Root cron job. I do not know where to go from here.

closed as off-topic by Jeff Schaller, Stephen Rauch, Anthon, Anthony Geoghegan, Kusalananda Sep 3 '17 at 19:14

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions describing a problem that can't be reproduced and seemingly went away on its own (or went away when a typo was fixed) are off-topic as they are unlikely to help future readers." – Jeff Schaller, Stephen Rauch, Anthon, Anthony Geoghegan, Kusalananda
If this question can be reworded to fit the rules in the help center, please edit the question.

  • Are the cronjobs running as user root? Did you edit /etc/crontab ? Have you added the cronjobs previously as root? What is crontab -l saying? Did you use at or batch ? What do sudo ls -l /var/spool/cron/* say ? Edit your question to improve it please! – Basile Starynkevitch Sep 1 '17 at 8:08
  • don't comment but please edit your question, also showing /etc/crontab file and files under /etc/cron* – Basile Starynkevitch Sep 1 '17 at 8:13
  • Updated question with your questions and results. Do you see something i that could cause the question issue? – Dror Sep 1 '17 at 9:00
  • 1
    There is not by any chance a copy of machine 1 running with the old cron job still active? – Kusalananda Sep 1 '17 at 9:16
  • umm, i have an older Amazon Machine Images (AMI) of that machine , but it should be just an image .. – Dror Sep 1 '17 at 9:18
0

Well, There was another service (third party) which i gave access key to my ec2 instance that open/shut my instance and i forgot about it. Well, i deleted it back than and so i assumed it wont be active anymore.

Anyhow, the case is solved.

Thank you all.

Not the answer you're looking for? Browse other questions tagged or ask your own question.