Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8164967
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T19:25:54+00:00 2026-06-06T19:25:54+00:00

I have a crontab the compress log files. In crontab -e I have -I’m

  • 0

I have a crontab the compress log files.

In crontab -e I have -I’m root-:

5 3 * * 6 find /toMyLogs -name "access*" -a ! -name '*.bz2' -ctime +7 -exec bzip2 -zv {} \;
35 3 * * 6 find /toMyLogs -name "error*" -a ! -name '*.bz2' -ctime +7 -exec bzip2 -zv {} \;

An example of the logs are:

$ ls -la /toMyLogs
-rw-r--r--   1 root     root       33317 Jul  2 19:04 error_1.log.2012-07-02
-rw-r--r--   1 root     root       12928 Jul  3 08:55 error_2.log.2012-07-03

If I execute the command by hand, this is:

find /toMyLogs -name "access*" -a ! -name '*.bz2' -ctime +7 -exec bzip2 -zv {} \;

it works, but in cron does not work. I did some mini-test with example files -not the logs- and ran cron. It worked. So, cron is definitively running.

Do you have any idea of whats is going on. Permissions or the time?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T19:25:55+00:00Added an answer on June 6, 2026 at 7:25 pm

    The environment is set up differently when you run cron. It is quite possible that the PATH used by cron does not find the bzip2 program.

    Reasons why crontab does not work

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Have the following cronjob set up in root's crontab: (centos 5.x) 2 * *
I don't have a server, so i don't have crontab access. I am thinking
I have a crontab that looks like: SHELL=/bin/bash PATH=/sbin:/bin:/usr/sbin:/usr/bin MAILTO=root HOME=/ 0-59 * *
i have this crontab, * * * * * php /etc/raddb/overloaded.php but it is
I have a bash script activated by crontab and running in background. I would
I need to have a query string in my crontab but it isn't working.
I have debian linux. I've created from user crontab -e this text: 0 *
Excuse me if it is a repeat. I have crontab entries which look like:
I have an entry in my crontab that looks like this: 0 3 *
I have written a Perl script that runs as a daily crontab job that

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.