How to remove .git crons from the system?

I am having difficulty finding where the exact crons are being hosted.

[root@terra ~]# crontab -l

0 * * * * /usr/local/CyberCP/bin/python /usr/local/CyberCP/plogical/findBWUsage.py >/dev/null 2>&1
0 * * * * /usr/local/CyberCP/bin/python /usr/local/CyberCP/postfixSenderPolicy/client.py hourlyCleanup >/dev/null 2>&1
0 0 1 * * /usr/local/CyberCP/bin/python /usr/local/CyberCP/postfixSenderPolicy/client.py monthlyCleanup >/dev/null 2>&1
0 2 * * * /usr/local/CyberCP/bin/python /usr/local/CyberCP/plogical/upgradeCritical.py >/dev/null 2>&1
0 2 * * * /usr/local/CyberCP/bin/python /usr/local/CyberCP/plogical/renew.py >/dev/null 2>&1
7 0 * * * “/root/.acme.sh”/acme.sh --cron --home “/root/.acme.sh” > /dev/null
0 0 * * * /usr/local/CyberCP/bin/python /usr/local/CyberCP/IncBackups/IncScheduler.py Daily
0 0 * * 0 /usr/local/CyberCP/bin/python /usr/local/CyberCP/IncBackups/IncScheduler.py Weekly
/3 * * * * if ! find /home//public_html/ -maxdepth 2 -type f -newer /usr/local/lsws/cgid -name ‘.htaccess’ -exec false {} +; then systemctl restart lsws; fi
09,39 * * * * /usr/local/CyberCP/bin/cleansessions >/dev/null 2>&1

*/30 * * * * /usr/local/CyberCP/bin/python /usr/local/CyberCP/IncBackups/IncScheduler.py ‘30 Minutes’
0 * * * * /usr/local/CyberCP/bin/python /usr/local/CyberCP/IncBackups/IncScheduler.py ‘1 Hour’
0 */6 * * * /usr/local/CyberCP/bin/python /usr/local/CyberCP/IncBackups/IncScheduler.py ‘6 Hours’
0 */12 * * * /usr/local/CyberCP/bin/python /usr/local/CyberCP/IncBackups/IncScheduler.py ‘12 Hours’
0 1 * * * /usr/local/CyberCP/bin/python /usr/local/CyberCP/IncBackups/IncScheduler.py ‘1 Day’
0 0 */3 * * /usr/local/CyberCP/bin/python /usr/local/CyberCP/IncBackups/IncScheduler.py ‘3 Days’
0 0 * * 0 /usr/local/CyberCP/bin/python /usr/local/CyberCP/IncBackups/IncScheduler.py ‘1 Week’

The git repository is removed from the CyberPanel, however, I am still receiving emails from the cron-jobs, unfortunately, I am unable to find where those cron jobs are located.

Any help?

Happy New Year @tanchev Happy you are here

RUn

$ ls /var/spool/cron/crontabs/
# the result will be: root someuser1234 otheruser2345
$ nano /var/spool/cron/crontabs/someuser1234
$ nano  /var/spool/cron/crontabs/otheruser2345
# remove all the cronjobs you do not need
$ service crond restart || sudo service cron restart

Hello, thank you, happy new year to you too. Bless you and your family, I wish all the health in the world ^_^.

As far as I understand you want me to go into the crontabs directory, however, I am unable to see that directory as you can see below:

Screenshot by Lightshot

The issue is that I tried creating a github repository and attach it to Cyberpanel, I have then removed it, however, I am still receiving emails from a cron job that the repository is not found. I am unable to find that cron, I want to remove it so I don`t receive emails anymore. However Like I said, I do not have crontabs directory as you can see in the picture above.7

Screenshot by Lightshot

Nonetheless if I vim the root file that is in the ‘cron’ directory this is the output:

Screenshot by Lightshot

I do not see anything connected to git in any way. There are just the regular CyberPanel cron jobs and this is how suppose to be because I have not created any additional ones on my server, however, there is cron because I receive email every day that there is no git repository.

:pray: see here

you did not change directory to correct one. Its /var/spool/cron/crontabs/check my previous post How to remove .git crons from the system? - #2 by josephgodwinke

Hi, thanks for the reply.

There is no crontab directory in the cron directory, there is only root file. See below:

Screenshot by Lightshot

Is this debian? what version or what os is this

Hello,
It is CentOS 7.

Using crontab -e and deleting whichever cronjob you do not need should work

Yes, it should, however, the cron for the issue aforementioned is nowhere to be found in this file as I already mentioned in my first post starting this article. So this is rather a glitch of some sort than something else I was just hoping that someone is aware of it and can advise accordingly.

You are using centos 7 which by itself has diverse number of bugs running cyberpanel on that are really a challenge to figure out or fix. This bug sounds like its more so related to centos rather than cyberpanel.

I highly recommend AlamaLinux 8.4 if you are so into RHEL based distros or that is your expertise.

However the best choice is ubuntu 20.04 barely any bugs when using cyberp and the best so far for cyberpanel.

Hello @tanchev,
just goto /home/cyberpanel/git and list files

cd /home/cyberpanel/git
ls

And you’ll get all the domain/website here that have enabled git. These are the sites currently receiving git emails
If you remove any of these sites from that directory, it will stop sending commit emails via cron. for example if you see example.com inside /home/cyberpanel/git removing it will stop sending email for example.com

According to cyberpanel/IncScheduler.py at stable · usmannasir/cyberpanel · GitHub
it is using the below code to send email

                for website in os.listdir(IncScheduler.gitFolder):
                finalText = ''
                web = Websites.objects.get(domain=website)

                message = '[%s Cron] Checking if %s has any pending commits on %s.' % (
                    type, website, time.strftime("%m.%d.%Y_%H-%M-%S"))
                finalText = '%s\n' % (message)
                GitLogs(owner=web, type='INFO', message=message).save()

Unfortunately, even if you don’t have any git or remove git from the panel, the site will still be in that directory; in fact, simply clicking on the init git button inside the manage git option will create this folder even if you don’t proceed further, and this will start sending emails, which is very bad for shared hosting because many of our users don’t understand this feature and, to explore, they click on it and start receiving annoying emails. This problem should be solved soon.

@usmannasir