nixCraft Linux Forum

nixCraft

Linux / UNIX Tech Support Forum

Bash not working!

This is a discussion on Bash not working! within the Getting started tutorials forums, part of the Linux Getting Started category; Hello nixcrafters, i am trying to run a bash script with cron. this is the formart i have put it ...

Register free or login to your existing account and remove all advertisements.


Go Back   nixCraft Linux Forum > Linux Getting Started > Getting started tutorials

Linux answers from nixCraft.


Getting started tutorials So much to read, so little time! If that is your problem, we have solution. Read our FAQ and tutorials to help you cut through the clutter of information overload. Only members of "contributors" group can post new tutorials. Other members can just reply to thread.

Reply

 

LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 10-01-2007, 03:17 PM
Junior Member
User
 
Join Date: Oct 2007
OS: Fedora Core 6
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
Mwalimugini is on a distinguished road
Send a message via AIM to Mwalimugini Send a message via MSN to Mwalimugini Send a message via Skype™ to Mwalimugini
Unhappy Bash not working!

Hello nixcrafters,

i am trying to run a bash script with cron. this is the formart i have put it in the crontab..
***** bash /path/to/script/script.sh

the problem is that it is not executing the script which is supposed to connect via telnet. I wud appreciate any help or advice. Thanks all

my AIM IM is mwalimugni
Reply With Quote
  #2 (permalink)  
Old 11-23-2007, 05:06 PM
Junior Member
User
 
Join Date: Sep 2007
OS: Red Hat
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
tuxg is on a distinguished road
Default

Hi,

Give the pathname of bash on your system and see if it works.
Something like:
***** /bin/bash /path/to/script/script.sh
Reply With Quote
  #3 (permalink)  
Old 11-24-2007, 12:02 PM
monk's Avatar
Senior Member
User
 
Join Date: Jan 2005
Location: Tibet
OS: Debian GNU/Linux
Posts: 506
Thanks: 0
Thanked 8 Times in 6 Posts
Rep Power: 7
monk has a spectacular aura about monk has a spectacular aura about
Default

Well, add #!/bin/bash top of script ie. open /path/to/script/script.sh and make sure 1st line is:
Code:
#!/bin/bash
__________________
May the force with you!
Reply With Quote
  #4 (permalink)  
Old 12-06-2007, 04:25 PM
anilvrathod's Avatar
Junior Member
User
 
Join Date: Dec 2007
Location: Pune
OS: Red Hat
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
anilvrathod is on a distinguished road
Default Bash Not Working

Dear Friend

use following format fot your crontab
* * * * * sh /path_of_/your_bash_script
Reply With Quote
  #5 (permalink)  
Old 03-24-2008, 10:52 PM
Member
User
 
Join Date: Mar 2008
OS: Debian, Slackware, LFS
Posts: 82
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 2
Tux-Idiot is on a distinguished road
Default

Quote:
Originally Posted by tuxg View Post
Hi,

Give the pathname of bash on your system and see if it works.
Something like:
***** /bin/bash /path/to/script/script.sh
+ chmod +x file.sh (may also source file.sh cron file)
+ check if user is in allow.cron or in deny.cron
+ man 1 cron
+ man 5 cron
+ man crontab
+ lastly check the crontab
crontab -l [username/login id]
if not okay? edit
crontab -e [username/login id]
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
Thread Tools
Display Modes

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 On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads

Thread Thread Starter Forum Replies Last Post
Samba Server not working vaibhav.kanchan Getting started tutorials 2 01-08-2008 07:14 PM
Spamassassin URI rule not working properly diptanjan Mail Servers 2 06-26-2007 12:11 PM
logrotate not working muks Web servers 2 03-17-2007 05:50 AM
Is NTP Working? illtestu Linux software 1 05-22-2006 11:36 PM
iptables bittorrent not working Linux software 2 01-25-2006 08:52 PM


All times are GMT +5.5. The time now is 05:11 AM.


Powered by vBulletin® Version 3.8.4 - Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.2
©2005-2009 nixCraft. All rights reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38