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 04-30-2012, 07:39 PM   #1
kfurlotte
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 retsimport.sh 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:
Code:
#!/bin/sh

cd

cd public_html/exitrealty

pwd

drush -u admin -d rets-import

pwd
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 retsimport.sh, bash ./retsimport.sh, sh retsimport.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
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
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".



Cheers,
Tink
 
1 members found this post helpful.
Old 04-30-2012, 08:30 PM   #3
kfurlotte
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.
  


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

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

All times are GMT -5. The time now is 04:18 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
Open Source Consulting | Domain Registration