Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 3 of 3
  1. #1
    Member ullalla's Avatar
    Join Date
    Jan 2006
    Posts
    192

    Default cron not executing

    I have a script to take daily backups for cpanel users the scripts is like :

    #!/bin/bash
    Time=`date "+%Y.%m.%d-%A"`
    bakdst=/home/DailyBackup
    mkdir -p $bakdst/$Time

    for U in `cat lst`;
    do
    /scripts/pkgacct $U;
    mv cpmove-$U.tar.gz > /home/DailyBackup;
    done

    echo " ................. Successfully Done ............................"

    exit 0
    If I run this script manually then it generates the backup and moves to destination properly but when I use cronjob to do so it wont work I have set the cron as :

    0 4 * * * /bin/bash /home/backup.sh

    As well cron logs aren;t hleping as :

    Mar 16 10:30:01 server1 crond[8246]: (root) CMD (/bin/bash /home/bacup.sh)

    Any guideline on this is appreciated.
    Last edited by ullalla; 03-16-2011 at 09:16 AM.

  2. #2
    cPanel Staff cPanelTristan's Avatar
    Join Date
    Oct 2010
    Location
    somewhere over the rainbow
    Posts
    6,305
    cPanel/Enkompass Access Level

    Root Administrator

    Default Re: cron not executing

    Are you running the cron as the root user in crontab -e or as some non-root user?

    Are crons even running on the system?

    Code:
    ps aux | grep cron
    Does the cron command get executed at all?

    Code:
    grep backup.sh /var/log/cron
    cPResources: Support Options | More Support Options | Forums Search | cPanel.net Site Search | Mailing Lists(Alt) | Docs
    -- Tristan, Forums Technical Analyst, cPanel Tech Support

    Submit a ticket | Check an existing ticket

  3. #3
    Member ullalla's Avatar
    Join Date
    Jan 2006
    Posts
    192

    Default Re: cron not executing

    I am running cron as root user and yes crond is running on the server.

    the cron log are saying nothing :

    Mar 16 10:30:01 server1 crond[8246]: (root) CMD (/bin/bash /home/bacup.sh)

Similar Threads & Tags
Similar threads

  1. Root Crons Not executing~
    By procam in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 02-11-2007, 03:29 PM
  2. PHP files not executing
    By deepak_k_rana in forum cPanel and WHM Discussions
    Replies: 9
    Last Post: 12-13-2006, 10:00 AM
  3. executing programs
    By XMorTus in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 10-18-2004, 07:28 AM
  4. cPanel cron jobs or cron.daily , cron.hourly , etc.?
    By spaceman in forum cPanel and WHM Discussions
    Replies: 6
    Last Post: 01-01-2004, 07:16 PM
  5. Scripts not executing
    By donnie in forum cPanel and WHM Discussions
    Replies: 2
    Last Post: 06-08-2003, 08:10 AM
Tags for this Thread
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube