Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

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 created a Shell Script as below

  echo "Hi there"

I also added cron job in cron tab which is under /etc/crontab as below

* * * * * /home/ > /home/Sample.txt

I have created the Sample.txt file in /home/ directory.

I have also checked the permission for read and write for both the file

When I execute the file it works writes in Sample.txt file

Now I don't understand why it is not writing in the Text file from the cron task i scheduled

I am using Ubuntu 10.04

Please Help me in fixing this issue

share|improve this question
up vote 3 down vote accepted

You are using the system crontab which has a slightly different format; specifically, the date-time fields must be followed by a user field which tells cron who to run the command that follows as.

So the syntax in this case should be something like:

* * * * * username /home/username/ > /home/username/Sample.txt
share|improve this answer

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.