LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Closed Thread
  Search this Thread
Old 05-23-2011, 04:02 AM   #1
Annielover
Member
 
Registered: May 2011
Location: Belgium
Distribution: Ubuntu Server Edition, Fedora 16
Posts: 90

Rep: Reputation: 8
crontab does not run all lines of a script, but manually it works perfect.


Hello,

I use crontab to execute a bash script every minute and the output is redirected to a log file.
In that bash script there is a screen command to start a screen session.
When I execute the script manually it works perfect, but with crontab, the screen command is not executed, but the echo's are. Because they are written in the log file...

Here's my script:

Script removed for violation of LQ Rules

So the script runs perfect when I do it manually, but not with cron...

Here's my crontab (sudo crontab -e)

# m h dom mon dow command
*/1 * * * * sudo /home/laurent/Games/Cod4/StartCod4.sh | egrep 'running|started' >> /home/laurent/Games/Cod4/Serverlog.log

Any ideas on how to solve this??

Thanks!!

Last edited by XavierP; 05-23-2011 at 07:19 AM.
 
Old 05-23-2011, 05:03 AM   #2
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,529

Rep: Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899
Since cron uses a limited PATH, try to use the whole path to the commands and files.

Kind regards
 
Old 05-23-2011, 05:56 AM   #3
Annielover
Member
 
Registered: May 2011
Location: Belgium
Distribution: Ubuntu Server Edition, Fedora 16
Posts: 90

Original Poster
Rep: Reputation: 8
I did, but that didn't help, any other ideas?

Here is what my script looks like now:


Script removed for violation of LQ Rules

When I run it manually, it works perfect again, but not with cron...

Last edited by XavierP; 05-23-2011 at 07:20 AM.
 
Old 05-23-2011, 06:34 AM   #4
crts
Senior Member
 
Registered: Jan 2010
Posts: 2,020

Rep: Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757
Quote:
Originally Posted by Annielover View Post
#!/bin/bash -l
#Script to start the cod4 cracked server
...
I am not sure if your script violates any LQ rules. You are asking for assistance in conjunction with cracked servers.
 
Old 05-23-2011, 06:56 AM   #5
Annielover
Member
 
Registered: May 2011
Location: Belgium
Distribution: Ubuntu Server Edition, Fedora 16
Posts: 90

Original Poster
Rep: Reputation: 8
Nah, I bought the CD, and downloaded a cracked .exe so that players with a cracked version of the game could also play on my server...
Nothing wrong with that, though?
 
Old 05-23-2011, 06:59 AM   #6
crts
Senior Member
 
Registered: Jan 2010
Posts: 2,020

Rep: Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757
Quote:
Originally Posted by Annielover View Post
Nah, I bought the CD, and downloaded a cracked .exe so that players with a cracked version of the game could also play on my server...
Nothing wrong with that, though?
I don't know. I guess it is up to the moderators to decide that.
 
Old 05-23-2011, 07:07 AM   #7
Annielover
Member
 
Registered: May 2011
Location: Belgium
Distribution: Ubuntu Server Edition, Fedora 16
Posts: 90

Original Poster
Rep: Reputation: 8
But I bought the game, so nothing illegal...
And I'm quite sure that you have some cracked or illegal games as well, so why doing difficult?
Besides, I payed the game...

And instead of blaming me, you'd better look for a solution to solve my problem with the BOUGHT version of the game!
 
Old 05-23-2011, 07:17 AM   #8
XavierP
Moderator
 
Registered: Nov 2002
Location: Kent, England
Distribution: Debian Testing
Posts: 19,192
Blog Entries: 4

Rep: Reputation: 475Reputation: 475Reputation: 475Reputation: 475Reputation: 475
Despite the fact that you bought a single copy of the game, you are attempting to enable others to play versions that have been obtained illegally. That is in clear violation of the LQ Rules:
Quote:
Originally Posted by LQ Rules
Posts containing information about cracking, piracy, warez, fraud or any topic that could be damaging to either LinuxQuestions.org or any third party will be immediately removed.
I would also like to point out the following: LQ has no paid positions, all members answer questions on a volunteer basis and no member has the right to demand a response.

I have now closed and cleaned up this thread.
 
  


Closed Thread



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 Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Script won't run in crontab.... only manually ScorchPipe Linux - Newbie 7 03-22-2011 10:11 AM
[SOLVED] Commented out lines in crontab still run? Subject16 Linux - General 5 09-20-2010 09:30 AM
My BASH script work perfect when i run it manualy, but not when it run in the crontab roqarg Linux - Newbie 30 05-06-2010 01:37 PM
[SOLVED] script not running via crontab, run's fine manually astroboiii Linux - Software 10 02-08-2010 10:36 PM
Script works when run manually but not in cron job Harlin Linux - Software 7 10-16-2007 06:36 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 04:03 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