LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-10-2018, 03:47 AM   #1
tocii.
LQ Newbie
 
Registered: Jan 2018
Distribution: Ubuntu, Mint
Posts: 27

Rep: Reputation: Disabled
Red face Crontab isn't working


Hi everyone. I want schedule for explame a bash script, to write out "Hello World.".
I opened the file with command: 'crontab -e', then wrote to the last line '* * * * * sh /home/test.sh'
But it isn't working, I can't see that "hello World" message.
Someone can help me? Thank you!
 
Old 01-10-2018, 04:06 AM   #2
JJJCR
Senior Member
 
Registered: Apr 2010
Posts: 1,636

Rep: Reputation: 277Reputation: 277Reputation: 277
what's inside test.sh?

if you run ./test.sh are you able to see the "Hello World."

or try this:

* * * * * /home/test.sh

I remove sh before the forward slash

Last edited by JJJCR; 01-10-2018 at 04:09 AM. Reason: edit
 
Old 01-10-2018, 04:08 AM   #3
tocii.
LQ Newbie
 
Registered: Jan 2018
Distribution: Ubuntu, Mint
Posts: 27

Original Poster
Rep: Reputation: Disabled
Yes, when I run the Shell script in terminal with 'sh /home/test.sh' command, then work good.
 
Old 01-10-2018, 04:11 AM   #4
JJJCR
Senior Member
 
Registered: Apr 2010
Posts: 1,636

Rep: Reputation: 277Reputation: 277Reputation: 277
I edited my post see updated post above.
 
Old 01-10-2018, 04:16 AM   #5
tocii.
LQ Newbie
 
Registered: Jan 2018
Distribution: Ubuntu, Mint
Posts: 27

Original Poster
Rep: Reputation: Disabled
I saw that. But isn't good.

EDIT: Or crontab running only in the background?

Last edited by tocii.; 01-10-2018 at 04:19 AM.
 
Old 01-10-2018, 04:45 AM   #6
AwesomeMachine
LQ Guru
 
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 5,513

Rep: Reputation: 1004Reputation: 1004Reputation: 1004Reputation: 1004Reputation: 1004Reputation: 1004Reputation: 1004Reputation: 1004
I don't know how cron interprets all *. I think you might require a number somewhere in there. And, the script will probably print to /var/log/messages if it's run from the cron daemon.
 
Old 01-10-2018, 06:13 AM   #7
tocii.
LQ Newbie
 
Registered: Jan 2018
Distribution: Ubuntu, Mint
Posts: 27

Original Poster
Rep: Reputation: Disabled
I solved the problem. thanks everything.
 
Old 01-10-2018, 10:47 PM   #8
JJJCR
Senior Member
 
Registered: Apr 2010
Posts: 1,636

Rep: Reputation: 277Reputation: 277Reputation: 277
If you can share your solution, so others who might have the same issue is able to benefit from it. If you will be kind to share though.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Help!!! This isn't working!!! N1ckxch03 SUSE / openSUSE 5 08-14-2009 07:49 PM
Why isn't this working??? argon99 Linux - Wireless Networking 4 03-28-2009 08:56 AM
Crontab every 15 days, isn't possible? deqmacrom Linux - General 3 04-07-2005 02:31 AM
less isn't working! mathman0 Linux - Software 2 02-20-2005 11:13 AM
Sample of my /etc/crontab that isn't working..? stakhous Linux - Newbie 1 04-28-2004 04:39 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:12 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration