Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 04-30-2012, 07:39 PM   #1
LQ Newbie
Registered: Apr 2012
Posts: 2

Rep: Reputation: Disabled
sh script drush command not found

This is really basic, I've been looking everywhere for an answer, but I have no knowledge of linux scripting whatsoever.

What I want to do is run a command through a cron run on my linux server. The command is:

drush -u admin -d rets-import

I have a script called in my folder /bin/sh.
When I run the command through a command line, it works perfectly, but when it gets executed from the sh file, it gives me a command not found. The content of my script is the following:


cd public_html/exitrealty


drush -u admin -d rets-import

I have a cron job set up, I tried a few commands, but to be honest, I have no clue what to put exactly, so I've tried bash, bash ./, sh and a lot more, I just can't figure it out.

Help would be really appreciated, and I'm sorry if I duplicate from somewhere else, like I said, looked everywhere, I just don't get anything about this.
Old 04-30-2012, 08:09 PM   #2
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 927Reputation: 927Reputation: 927Reputation: 927Reputation: 927Reputation: 927Reputation: 927Reputation: 927
Hi, welcome to LQ!

Try to put the full path to "drush" in your script. cron has a very minimalistic
environment, and may not have the path to "drush".

1 members found this post helpful.
Old 04-30-2012, 08:30 PM   #3
LQ Newbie
Registered: Apr 2012
Posts: 2

Original Poster
Rep: Reputation: Disabled
Thanks a lot! Putting the full path to drush worked perfectly!
1 members found this post helpful.


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
LXer: Drush: Managing Drupal from the Command Line LXer Syndicated Linux News 0 01-31-2012 08:40 PM
BASH Script - command not found!! JavaNinja Linux - Newbie 12 12-01-2008 12:45 PM
Bash script says command not found - why? RavenLX Ubuntu 3 08-03-2007 03:19 PM
Bash Script; command not found twintornado Programming 2 06-01-2005 10:59 AM
command not found (My shell script) Swift&Smart Linux - Software 3 05-16-2004 12:14 AM > Forums > Linux Forums > Linux - Newbie

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

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