Bonjour j'ai un fichier shell : /usr/local/sbin/S3DServer_script start & qui fonctionne quand je le lance dans le Shell mais ne fonctionne pas avec le cron.

(je lance d'autre fichiers avec le crontab qui fonctionnent donc le cron est bien paramètré je pense.)

dans mon fichier shell :

Code : Sélectionner tout - Visualiser dans une fenêtre à part
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
start)
		if [ -e $S3DServerLife ]; then
			echo "S3DServer Advanced 1.5.1 for Linux seems to be running";
			echo "If you are sure the server is not running, delete $S3DServerLife"
			exit 1
		else
			echo "Starting S3DServer Advanced 1.5.1 for Linux"
			if [ -e S3DServer-1.5.1-Advanced-Linux ]; then
				if [ ! -x S3DServer-1.5.1-Advanced-Linux ]; then
					echo "S3DServer-1.5.1-Advanced-Linux is not executable, trying to set it"
					chmod u+x S3DServer-1.5.1-Advanced-Linux
				fi
				if [ -x S3DServer-1.5.1-Advanced-Linux ]; then
					./S3DServer-1.5.1-Advanced-Linux &
                    for c in $(seq 1 300); do
                        if [ ! -e $S3DServerLife ]; then
                            echo -n "."
                            sleep 1
                        else
                            echo "done"
                            break
                        fi
                    done
				else
					echo "S3DServer-1.5.1-Advanced-Linux is not executable, fix this"
					exit 4
				fi
			else
				echo "Couldnt find S3DServer-1.5.1-Advanced-Linux"
				exit 5
			fi
		fi
	;;


dans le crontab -e je fais :
# m h dom mon dow command
* * * * * /usr/local/sbin/S3DServer_script start & 2>&1 > /root/cmd.log