Answer the question
In order to leave comments, you need to log in
The bash script does not work, it does not give errors, what could be the problem?
There is a script.
#!/bin/bash
rootFolder=`pwd`
i=0
a=50
while [ "$i" -ge "$a" ];
do
$i+1
rsync -avz '-e shh' [email protected]$i.com:/folder1/folder2/ becupfolder$i/folder1/folder2
for $somefolder in `ls -d */ | grep -v '^_'`
do
ssh [email protected]$i.com
echo $somefolder
find $rootFolder/$somefolder/-name "*.waw" -type f -mtime -93 | rsync -avz '-e ssh' $rootFolder/$somefolder/spool/monitor/ [email protected]:$rootFolder/$somefolder/spool/monitor/{}\;
find $rootFolder/$somefolder/-name "*.mp3" -type f -mtime -93 | rsync -avz '-e ssh -p 22n' $rootFolder/$somefolder/spool/monitor/ [email protected]:$rootFolder/$somefolder/spool/monitor/ {}\;
exit
done
done
Answer the question
In order to leave comments, you need to log in
This is exactly what you wanted to write.
i=0
a=50
while ;
do
let i=$i+1
done
for ((i=0; i < 50; i++))
do
done
your script will never be executed, because $i is always less than $a. that is, the condition "as long as $i is greater than $a" is not satisfied at all. well and further: $i+1 is in general what and in what language?
in general, the noble code turned out
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question