Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a cron job that is scheduled to run everyday, other than changing the schedule, is there any other way to do a test run of the command right now to see if it works as intended?

share|improve this question
I don't understand your question? Why not simply run the command? – favadi Jul 10 '12 at 10:45
I know the command works when enter it in shell (my shell), but I want to know if it works when cron runs it, it could be affected by ENV or shell specific stuff (~ expansion) or ownership and permission stuff or ... – Ali Jul 10 '12 at 10:48
So why not create new cron job run every minute with same command? – favadi Jul 10 '12 at 11:12
This is exactly what I ended up doing, but I wondered if there is a way to tell cron you want a test run on job no 7 ! Surely others have had this problem/request/wish before! – Ali Jul 10 '12 at 13:55
up vote 12 down vote accepted

As far as i know there is no way to directly do that as cron has a special purpose - running schedules commands at a specific time. So the best thing is to either to manually create a crontab entry or write a script which removes and resets the environment.

share|improve this answer

You can force the crontab to run with following command:

run-parts /etc/cron.daily
share|improve this answer
...on the assumption that the OP's cron job (asked 3 years ago) is in cron.daily as opposed to an individual crontab. – Jeff Schaller Nov 24 '15 at 3:49
And only on linux I guess. but good to know. – Ali Nov 27 '15 at 12:45

You can simulate the cron user environment as explained in "Running a cron job manually and immediately". This will allow you to test the job works when it would be run as the cron user.

share|improve this answer
Welcome to Unix & Linux! Whilst this may theoretically answer the question, it would be preferable to include the essential parts of the answer here, and provide the link for reference. – slm Jul 1 '15 at 13:02

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.