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

  • SEARCH
  • Home
  • 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 6608863
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T19:39:17+00:00 2026-05-25T19:39:17+00:00

This should be pretty straight forward but I can’t seem to get getting it

  • 0

This should be pretty straight forward but I can’t seem to get getting it working despite reading several tutorials via Google, Stackoverflow and the man page.

I created a cron to run every 1 min (for testing) and all it basically does is spit out the date.

crontab -l
* * * * * /var/test/cron-test.sh

The cron-test file is:

echo "$(date): cron job run" >> test.log

Waiting many minutes and I never see a test.log file.

I can call the “test.sh” manually and get it to output & append.

I’m wondering what I’m missing? I’m also doing this as root. I wonder if I’m miss-understanding something about root’s location? Is my path messed up because it’s appending some kind of home directory to it?

Thanks!


UPDATE —————–

It does appear that I’m not following something with the directory path. If I change directory to root’s home directory:

# cd

I see my output file “test.log” with all the dates printed out every minute.

So, I will update my question to be, what am I miss-understanding about the /path? Is there a term I need to use to have it start from the root directory?

Cheers!

UPDATE 2 —————–

Ok, so I got what I was missing.

The script to setup crontab was working right. It was finding the file relative to the root directory. ie:

* * * * * /var/test/cron-test.sh

But the “cron-test.sh” file was not set relative to the root directory. Thus, when “root” ran the script, it dumped it back into “root’s” home directory. My thinking was that since the script was being run in “/var/test/” that the file would also be dumped in “/var/test/”.

Instead, I need to set the location in the script file to dump it out correctly.

echo "$(date): cron job run" >> /var/test/test.log

And that works.

  • 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-05-25T19:39:18+00:00Added an answer on May 25, 2026 at 7:39 pm

    You have not provided any path for test.log so it will be created in the current path(which is the home directory of the user by default).
    You should update your script and provide the full path, e.g:

    echo "$(date): cron job run" >> /var/log/test.log
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This should be pretty straight forward but I can't seem to get my newbie
This seems like it should be pretty straight forward, but I'm apparently confused. I
This should be pretty straight forward, and uploading works. BUT when I open the
This should be pretty straightforward, but I can't seem to find an explanation anywhere
This should be pretty simple, but I am new at LINQ. I have a
This feels like it should be pretty simple, but not much seems to be
How can I do this in a C# program? I'm pretty sure it should
The questions is pretty straight forward, and can't find the answer in any of
This should be pretty straightforward I would think. I have this string: [quote=Joe Johnson|1]Hi![/quote]
I'm running Mysql 5.0.77 and I'm pretty sure this query should work? SELECT *

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.