nixCraft Linux Forum

nixCraft

Linux 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 ...


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

Register FAQ Members List Calendar Forgotten your password? Mark Forums Read
  #1 (permalink)  
Old 10-01-2007, 03:17 PM
Junior Member
User
 
Join Date: Oct 2007
My distro: Fedora Core 6
Posts: 1
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
Sponsored Links
  #2 (permalink)  
Old 11-23-2007, 05:06 PM
Junior Member
User
 
Join Date: Sep 2007
My distro: Red Hat
Posts: 1
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
My distro: Debian GNU/Linux
Posts: 482
Rep Power: 5
monk will become famous soon enough monk will become famous soon enough
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
My distro: Red Hat
Posts: 13
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
My distro: Debian, Slackware, LFS
Posts: 83
Rep Power: 1
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

Bookmarks


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 On

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 09:05 PM.


Powered by vBulletin® Version 3.7.4 - Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0

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