sis_site="ftp.altlinux.ru" sis_url="/pub/distributions/ALTLinux/Sisyphus/i586/RPMS.kernel" real_url="/pub/distributions/ALTLinux/Sisyphus/files/i586/RPMS" local_path="/mnt/win_d/sisyph/files.kernel/i586" today_folder=RPMS.`date +%Y%m%d` today_path=$local_path/$today_folder [ -d $local_path/$today_folder ] || mkdir $local_path/$today_folder lftp -c "open $sis_site; cd $sis_url; ls " | awk '{print $9}' | \ ( \ echo open $sis_site; echo cd $real_url; while read pkg_name; do path_to=`find $local_path -name "$pkg_name" -printf "%h\n"`; [[ $path_to ]] || path_to=$today_path; inblack=`echo $pkg_name | sed --silent -f blacklist-new | tail -n 1` [[ $inblack = "yes" ]] || [ -e $path_to/$pkg_name ] || (echo lcd $path_to; echo get -c $pkg_name); done ) ##### | \ lftp