#!/bin/bash CUR_PATH='/data/ftp/windows' path=$CUR_PATH for dir in $(ls $path) do echo $dir scp -P 22 -r $dir root@124.2*.x.x:/data/www/ftp/ done