Bonjour ,
s'il vous plait j'aimerai avoir un programme qui exécute le code chaque 15 min en sh
merci par avance
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 i=11 clear echo " " > ping.log while [ "$i" != 63 ] do echo "scan $i" output=`cat list.txt | grep "$i" | cut -d "=" -f 2 ` > cmp output=`cat list.txt | grep "$i=170" | cut -d "=" -f 2 ` name=`cat list.txt | grep "$i:" | cut -d ":" -f 2 ` a=$(grep -o "170." cmp | wc -l) echo "$a:$name" ping -c 4 "$output" > /dev/null if [ $? -eq 0 ]; then sshpass -p CitrecKbii ssh -o StrictHostKeyChecking=no "$output" '{ hostname echo -n "1;" > file.txt # ping pointeuse sshpass -p 'CitrecKbii' scp file.txt root@170.164:/root }' d=$(date +"%d/%m/%y;%T") echo -n $d >> ping.log echo -n ";$output;" >> ping.log cat file.txt >> ping.log else echo "$output;0" >> ping.txt fi i=$(($i + 1)) done
Partager