Techridez
VirtualizationLinuxWindowsNetworking
  • Techridez Knowledge base
  • Techridez guide
  • Tech Scale
    • Measurements
  • Techridez Knowledge Base
  • Bacis
    • Protocol and Port Numbers
  • Windows Customization
    • Capture Wim image from OS
  • Virtualization
    • Proxmox Command Guide
  • Windows Server Guide
    • Transfer FSMO roles
    • FSMO commands
  • DevOps
    • WebDev
      • How to install fail2ban on ubuntu server and create custom jail config.
      • MySQL Bin Files Eating Lots of Disk Space (fix)
      • Install ClamAV antivirus in Ubuntu Server and Client With Cron job
      • 404 hyperlink not working after wordpress migration
      • Apache Virtual Host Script with mysql db.
      • OsTicket
      • How to Backup MySQL Databases Automatically on Ubuntu
      • Cron Job
        • Create cron job for maldet scanning
        • Auto-Restart MySQL When It Crashes During a Brute Force Attack
        • How to change default crontab editor
        • How To Use Cron to Automate Tasks on Ubuntu 18.04
        • How To Use Cron to Automate Tasks on CentOS 8
      • Wordpress Security
      • Open database Error!: could not find driver linux Fix
    • Vagrant
    • Windows Subsystem for Linux
    • How to set static ip on ubuntu server using yaml file.
    • How to install ansible
  • Linux
    • Tools
    • How to install CrowdStrike in Linux
    • How to Install Ossec agent in linux
    • Linux Commands
    • SFTP (CrushFTP)with HA
    • 🗃️Transfer & sync files in a directory to remote node using crontab & rsync
  • Networking
    • Upgrade Cisco9200L firmware to recommended
  • Cyber Security
    • ISC² (International Information System Security Certification Consortium)
Powered by GitBook

©️ Techridez

On this page

Was this helpful?

  1. DevOps
  2. WebDev
  3. Cron Job

Create cron job for maldet scanning

first you need to edit maldet monitor path

for that to to /usr/local/maldetect/monitor_paths

#add your paths for scanning 
/home
/etc
/var/www/

then save that

go to home

I am using root so my directory is /root

then create maldet.sh and edit

#start maldet service
systemctl start maldet.service
#start maldet monitor
maldet --monitor /usr/local/maldetect/monitor_paths

above command will enable maldet service and run monitor to the paths which is already mentioned

now edit cron job

sudo crontab -e

if you are using first time it will ask for your edit which you want to access cron job, i am using nano, which is easier.

if you messed up by selecting wrong editor ?

No problem, use this link to refix.

https://docs.techridez.com/techridez/devops/webdev/cron-job/how-to-change-default-crontab-editor

# Edit this file to introduce tasks to be run by cron.
#
# Each task to run has to be defined through a single line
# indicating with different fields when the task will be run
# and what command to run for the task
#
# To define the time you can provide concrete values for
# minute (m), hour (h), day of month (dom), month (mon),
# and day of week (dow) or use '*' in these fields (for 'any').
#
# Notice that tasks will be started based on the cron's system
# daemon's notion of time and timezones.
#
# Output of the crontab jobs (including errors) is sent through
# email to the user the crontab file belongs to (unless redirected).
#
# For example, you can run a backup of all your user accounts
# at 5 a.m every week with:
# 0 5 * * 1 tar -zcf /var/backups/home.tgz /home/
#
# For more information see the manual pages of crontab(5) and cron(8)
#
# m h  dom mon dow   command
00 23 * * * /root/maldet.sh

as you can see only one command is there which is uncommented, every day at 23 Hours this will triger maldet scanning.

enjoy.

PreviousCron JobNextAuto-Restart MySQL When It Crashes During a Brute Force Attack

Last updated 4 years ago

Was this helpful?