Advertisement: Linux VPS from $4/month - contact support for custom offer.
+ Post New Thread
Results 1 to 2 of 2

Thread: Why cronjob from /etc/cron.monthly/weekly/daily/hourly do NOT run?

  1. #1
    Administrator
    Join Date
    Mar 2013
    Posts
    2,811

    Why cronjob from /etc/cron.monthly/weekly/daily/hourly do NOT run?

    What can be causes that script in /etc/cron.monthly/weekly/daily/hourly folder does not do its job/not executed/not run?

    I think this may help:

    check that script has right permission (-rw------- root root)

    # stat /path/to/script

    now change to proper permission for Linux cron

    chmod 600 /path/to/script

    check that there is new line at the end of script

    command on the last line
    # this is the end
    check that cron service is running (pid exist)

    # pgrep cron

    try to add this line to the beginning of the script:

    #!/bin/sh

    try to use full pathes for commands in the script

    like not "find parametershere", but "/usr/bin/find parametershere" to discover full path, do example. "which find" command or "which grep" etc.

    check that user that should run the script is defined

    if the script is launched from an file in /etc/cron.d/ directory, then try to add "root" into the file, ie.:
    0 */1 * * * root /usr/sbin/tmpwatch -am 1 /tmp/nginx_client

  2. #2
    Junior Member imort's Avatar
    Join Date
    Apr 2016
    Posts
    15


    Is this useful / helpfull? Yes | No
    I can also add a few tips and tricks here:

    1. Try add output redirecting to the end of the line to some log file, it can help you to investigate cron jobs issues in future.
    You can do it like that:

    #!/bin/sh
    echo date > /var/logs/myjob.log
    rsync -a -R /folder1/ /folder2 >> /var/logs/myjob.log

    You'll see any rsync output here

    2. Check any directory paths for running commands too
    For example, if you run 'rsync ./ /folder2' you'll need to add 'cd /folder1' before that to script work!

    You also can take a look to the my cron jobs article here.

+ Post New Thread

Similar Threads

  1. Bitcoin Hourly 2% Hourly For 100 Hour 200% Total Profit
    By kryper23 in forum General Advertisement
    Replies: 1
    Last Post: 11-21-2017, 07:44 AM
  2. New hourly 0.30% hourly
    By kryper23 in forum General Advertisement
    Replies: 2
    Last Post: 09-30-2017, 08:41 AM
  3. Replies: 0
    Last Post: 04-28-2017, 08:49 AM
  4. Replies: 1
    Last Post: 06-03-2016, 01:17 PM
  5. WTS JVMHost.com: Best Price Guarantee, Friendly Support, Weekly/Monthly Backup
    By Enterchat in forum Shared: Offers & Requests
    Replies: 0
    Last Post: 02-22-2016, 07:41 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
 Protected by : ZB BLOCK  &  StopForumSpam