1.ftp自动上传文件脚本 #!/bin/bash ftp -n<<! open 192.168.220.129 user ls toor binary hash cd /path/to/backup lcd /path/to/need/backup prompt mkdir `date +"%Y%m%d"` cd `date +"%Y%m%d"` mput * close bye ! open行--要备份到的主机IP user行--ls为要备份到的主机
[root@openfire1 script]# cat test.sh #!/bin/bash #通过scp推送文件到远程目录 for ip in `cat iplist` do echo $1 if [[ -z $1 ]]; then #"-z",如果为空 echo "Not find command." break else echo "$ip-------