LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 02-07-2007, 01:49 PM   #1
Xig
LQ Newbie
 
Registered: Feb 2007
Posts: 2

Rep: Reputation: 0
Permissions in cron'ed script


Hi everyone,

I have written a bash script that looks something like this:

Code:
start-stop-daemon --quiet --start --background --exec *application*
It works great when I run it from the command line, but I tried to cron it with the following:

Code:
33 19 * * * /home/user/scripts/./myscript
...and I receive the following error:

Code:
/bin/sh: /home/user/scripts/: Permission denied
Could anyone please offer some advice? I'm a bit confused as to why it will run on the command line, but not in my cron?

Xig

Last edited by Xig; 02-07-2007 at 01:54 PM. Reason: Misleading topic
 
Old 02-07-2007, 02:38 PM   #2
anomie
Senior Member
 
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora
Posts: 3,935
Blog Entries: 5

Rep: Reputation: Disabled
I think you meant to use:
Code:
33 19 * * * /home/user/scripts/.myscript
 
Old 02-10-2007, 06:36 AM   #3
Xig
LQ Newbie
 
Registered: Feb 2007
Posts: 2

Original Poster
Rep: Reputation: 0
Hi again,

Thanks anomie for the tip, but when I call it as you suggested I get a "not found" error.

But when the script is called, I now receive this error: "start-stop-daemon: not found"

I can't find "start-stop-daemon" in the filesystem anywhere, so I'm not sure if it's a path issue or ..

Any help appreciated!
 
Old 02-10-2007, 06:45 AM   #4
Guttorm
Senior Member
 
Registered: Dec 2003
Location: Trondheim, Norway
Distribution: Debian and Ubuntu
Posts: 1,453

Rep: Reputation: 447Reputation: 447Reputation: 447Reputation: 447Reputation: 447
Hi

You don't get the same environment with cron. I'd type the command:
echo $PATH
and copy the entire line.
Then, in the cron, add a line above the command:
PATH=...
 
  


Reply



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
How to stop daemon on FreeBSD ??? tritong *BSD 1 06-26-2006 11:36 AM
Debian "Start-Stop-Daemon" Notwerk Linux - Software 3 12-19-2005 03:16 AM
start-stop-daemon problems after process crash emarti20 Linux - Software 3 04-15-2005 08:54 AM
Logging with Start stop daemon bigsness Linux - General 0 01-19-2005 03:25 PM
How do I stop the sshd daemon? ebenh Linux - Software 5 09-04-2004 01:06 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 05:08 AM.

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