geekvenue.net

Welcome to Chucktips Hardware HELP WITH DEAD OS Installing FreeBSD Miscellaneous
 faq
 search
 add article
 cool-stuff
 how-to
 main
 tips
 parent


Tar problems with jpgs
by Tom Haddon on Thursday October 23, @05:38AM

Hi,

Does anyone know how to help me out with a rather bizarre problem? I have a cron job that's tar-ing and gzipping a directory (for a website), and it runs fine if I run it from the command line as root, but if I run it from cron (as root - in the /etc/cron.daily/ folder), it consistently fails on certain jpgs. The error message when unzipping and untar-ing the file to check for errors is "unexpected end of file" or something similar.

Here's the command:

tar -zcvpf /var/backup/site.tgz --directory /var/www/html .

Any help appreciated!!

Thanks, Tom

Related Links
  • Articles on Backup and Restore
  • Also by Tom Haddon
  • Contact author
  • Sponsors

    The Fine Print: The following comments are owned by whoever posted them.
    ( Add a Reply )

    Re: Tar problems with jpgs
    by Malc Kelly on Thursday April 15, @01:16AM

    I think it could be because:

    When you run it from the shell (manually) your environment is all setup. So you can use simple commands (ie tar, gzip, ls) as opposed to typing those commands with the full path (ie /bin/tar, /bin/ls).

    However when you run it from a cron, you are not logged in so there is no environment setup. Therefore when the machine reads the command tar or ls, it has no idea what your talking about. Try using the full path in your cron script


    [ Add a Reply to this ]
    Re: Tar problems with jpgs
    by mickes on Tuesday November 09, @10:26AM

    you may want to check to make sure that your backup directory allows write access for the cron user (I am assuming cron does not run as root). Cron will also need read access to the web sight's directories.

    Mike


    [ Add a Reply to this ]
    The Fine Print: The following comments are owned by whoever posted them.
    ( Article Reply )

    "You never know how many friends you have until you own a Condo on the beach." -- Jason's Postulate

    Powered by Zope  Powered by Apache  Squishdot Powered
    All trademarks and copyrights on this page are owned by their respective companies. Comments are owned by the Poster. The Rest ©2001 Jason Neumann.
    [ main | post article | search ]