Results 1 to 3 of 3

Thread: Crontab with shell script for creating tar issue

  1. #1
    Join Date
    Apr 2011
    Beans
    2

    Crontab with shell script for creating tar issue

    Hi All,
    I m using ubuntu 10.04, I have created on simple shell script to create tar of given folder the script is working fine. I have set crontab to run this script periodically it is also working fine on my local pc.
    but on cloud server this same thing gives me unexpected result.
    on server
    - If I run shell script directly it is working fine, create tar file and size of tar file around 20mb
    - If I use crontab then it create tar file but size of tar file around 15kb

    I have also try to view the cron log file, but it didnt give me any error message related with this issue.

    Please can any one help me to sort this issue.
    I will really appreciate your help.

  2. #2
    Join Date
    Jul 2009
    Location
    London
    Beans
    1,480
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: Crontab with shell script for creating tar issue

    Hi, add logging to capture the stdout and stderr output of the script.

    Code:
    * * * * * /path/to/your/script > /path/to/logfile 2>&1
    one possibility -- the issue described in this thread: http://ubuntuforums.org/showthread.php?t=825242

    if this is the problem, then the very fact of redirecting output as shown above should allow the job to complete.

  3. #3
    Join Date
    Apr 2011
    Beans
    2

    Re: Crontab with shell script for creating tar issue

    Quote Originally Posted by DaithiF View Post
    Hi, add logging to capture the stdout and stderr output of the script.

    Code:
    * * * * * /path/to/your/script > /path/to/logfile 2>&1
    one possibility -- the issue described in this thread: http://ubuntuforums.org/showthread.php?t=825242

    if this is the problem, then the very fact of redirecting output as shown above should allow the job to complete.
    Thanks DaithiF,

    It is working.

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •