我正在使用一个rhc openshift服务器。
所以ii安装了python并在其上安装了 pyftpsync 模块,所以我想通过ftp连接到anther主机,但是我收到了这个错误:< / p>
cd /tmp
cat << 'EOF' > ftp_sync.py
from ftpsync.synchronizers import DownloadSynchronizer, UploadSynchronizer,BiDirSynchronizer
from ftpsync.targets import FsTarget #, UploadSynchronizer, DownloadSynchronizer
from ftpsync.ftp_target import FtpTarget
import os
env_var = os.environ['OPENSHIFT_HOMEDIR']
local = FsTarget('/tmp')
passwd = "ss123456"
ip='sa1sss.atspace.cc';user='2025575';# sa1sss.atspace.cc XXXX@yahoo.om
remote = FtpTarget("/mashhadpc.tk", ip,21, user, passwd)
opts = {"force": False, "delete_unmatched": False, "verbose": 3, "execute": True, "dry_run" : False}
s = UploadSynchronizer(local, remote, opts)
s.run()
stats = s.get_stats()
print(stats)
EOF
nohup sh -c " ${OPENSHIFT_HOMEDIR}/app-root/runtime/srv/python/bin/python ftp_sync.py"> $OPENSHIFT_LOG_DIR/python_ftp_sync.log /dev/null 2>&1 &
tail -f $OPENSHIFT_LOG_DIR/python_ftp_sync.log
Mys sorce代码在这里:
public class abc{
public int a; //global and accessible by every class outside this class too
private int b; //global and accessible only within this class
private void m(){
int x; //local and accessible only within this method
}
}
所以正如你所看到的那样有ftp用户并为你的测试传递免费连接,那么我编写这些代码的错误是什么,这会导致错误。
非常感谢。