Skip to main content

Cron Job

Comments

4 comments

  • ModServ
    Just to be more organized, make a file let's say it's name will be "virscan" and put this in it:
    #!/bin/bash for i in `awk '!/nobody/{print $2 | "sort | uniq" }' /etc/userdomains | sort | uniq`; do /usr/local/cpanel/3rdparty/bin/clamscan -i -r /home/$i 2>>/dev/null; done >> /root/infections&
    Make it executable:
    chmod 755 virscan
    Move it to let's say "/usr/local/bin" then add this line in Cron:
    0 5 * * * /bin/bash /usr/local/bin/virscan
    BTW, you can reach cron by this command:
    crontab -e
    0
  • cPanelMichael
    Hello :) Yes, the previous post is accurate, and you should edit the root cron with the "crontab -e" command as mentioned. Thank you.
    0
  • keat63
    I looked at crontab -e yesterday, and thought it looked a bit fiddly. Is it not easier to modify the file using CS Explorer ? I'm away from the office for a few weeks after today, so i'll look at implimenting this when i get back (just in case something breaks) Thanks
    0
  • cPanelMichael
    You can edit the file manually if you prefer. The "e" flag opens it with the default text editor as defined in your bash profile. Thank you.
    0

Please sign in to leave a comment.