Default Cron Setup

Discussion in 'Linux VPS/Dedicated - General' started by guru_ck, Jun 1, 2007.

  1. guru_ck

    guru_ck New Member

    Hey Guys,

    I was trying to add an entry in cron to restart httpd every 12 hours but apparently I don't fully understand it yet. I'm afraid I might have screwed something up and I know CPanel has allot of entries in there so can you compare yours to mine and let me know what needs to be changed?

  2. guru_ck

    guru_ck New Member

    How come crontab -e dispalys different results than vi crontab?
  3. Dan

    Dan Moderator

    I'm definitely not an expert but it looks to me like vi crontab breaks the crontab into scheduled events whereas crontab -e is directly editing the crontab.

    This " */1 * * * * /sbin/service httpd restart" means you are restarting httpd once every minute...

    I would think that doing a crontab -e and then adding a line similar to "30 3 * * * /sbin/service httpd restart" which would restart httpd once every day at 3:30am would do the trick for you.
  4. KH-Paul

    KH-Paul CTO Staff Member

    /etc/crontab is a system cron configuration file - you can execute any tasks under any specified user permissions. "crontab -e [-u user]" allows you to edit per-user crontab located in the /var/spool/cron/ directory.

Share This Page