title: How to add a cron job entry using Chef recipe
body: <p>All,</p>
  
  <p>I have a shell script that is creates tar file of logs. I have embeded the recipe in the cookbook.</p>
  
  <p>The recipe looks like this :</p>
  
  <pre><code>cookbook_file "/var/create-tar.sh" do
  source "create-tar.sh"
  mode 0755
  end
  
  execute "create tar files of logs older than 1 day" do
  command "sh /var/create-tar.sh"
  end
  </code></pre>
  
  <p>The execute resource is executing the recipe. I want to schedule this shell script in cron by making an entry in cronjob.</p>
  
  <p>The crontab entry should be :</p>
  
  <pre><code>*/2 * * * * sh -x /var/test.sh  &gt; /var/log/backup 2&gt;&amp;1
  </code></pre>
  
  <p>How can I add this entry in my recipe?</p>