View Single Post
Old 06-25-2009, 06:48 PM   #4 (permalink)
office politics
office politics's Avatar
 
It's all just 1s and 0s

Join Date: Jan 2004

Location: in the lab

Posts: 4,425

office politics will become famous soon enough

Default Re: set shell script to show output?

after adding the verbose switch (-v) it started to show relative folder paths.

I'll try adding the progress switch. thanks in advance for the tip Jayce.

now i've created a shell script that you might be able to help with.

it's meant to mount windows shares then use rsync to sync files of particular directories.

it mounts the file share, but exits immediately after...which is when it comes to the for loop.

here's the code....it runs on knoppix

Code:
mkdir /mnt/srv3
mount -t smbfs -o username=office //srv3/cds /mnt/srv3
mkdir /mnt/srv
mount -t smbfs -o username=office //srv/nl /mnt/srv

for (( cd = 1 ; cd > 627 ; cd++ ))
do

echo "Trying cd $cd"

if [$cd < 10]
then

echo "Trying cd $cd"
rsync -av /mnt/srv3/CD000$cd/ /mnt/srv/CD000$cd/

else
  if [$cd < 100]
  then

  echo "Trying cd $cd"  
  rsync -av /mnt/srv3/CD00$cd/ /mnt/srv/CD00$cd/
  
  else
    if [$cd < 1000]
    then
    
    if [$cd > 626]
    then
    
    echo "Trying cd $cd"
    rsync -av /mnt/srv3/CD0$cd/ /mnt/srv/cd0$cd/
    
    fi
    
    echo "Trying cd $cd"
    rsync -av /mnt/srv3/CD0$cd/ /mnt/srv/CD0$cd/
    
    fi
  fi
fi

done

office politics is offline