แก้ปัญหา ftp backup ไม่ได้ ncftpls: Could not change directory

ปัญหาของ Directadmin [COLOR=#333333]version 1.42.1 (CentOS 5.x)

[/COLOR]ncftpls: Could not change directory หรือข้อความอื่นๆ เกี่ยวกับ ncftpls[COLOR=#333333]

FreeBSD สามารถใช้งานได้ปกติ[/COLOR]
อ้างถึง

แก้ปัญหาโดยเปลี่ยนใช้ [COLOR=#000000][FONT=courier new]CURL Backup
[/FONT][/COLOR]
#mkdir -p /usr/local/directadmin/scripts/custom/
#vi /usr/local/directadmin/scripts/custom/ftp_upload.php
#chmod +x /usr/local/directadmin/scripts/custom/ftp_upload.php


[COLOR=#000000][FONT=courier new]/bin/sh[/FONT][/COLOR]
[COLOR=#000000][FONT=courier new]# CURL Backup Transfer[/FONT][/COLOR]
[COLOR=#000000][FONT=courier new]# Version 0.1a[/FONT][/COLOR]
[COLOR=#000000][FONT=courier new]# Copyright 2006, Sensson (www.sensson.net)[/FONT][/COLOR]
[COLOR=#000000][FONT=courier new]#[/FONT][/COLOR]
[COLOR=#000000][FONT=courier new]# This script makes it possible to transfer[/FONT][/COLOR]
[COLOR=#000000][FONT=courier new]# backups using your secondary uplink[/FONT][/COLOR]
[COLOR=#000000][FONT=courier new]# like eth1.[/FONT][/COLOR]

[COLOR=#000000][FONT=courier new]ETH=eth0[/FONT][/COLOR]
[COLOR=#000000][FONT=courier new]CURL=/usr/local/bin/curl[/FONT][/COLOR]

[COLOR=#000000][FONT=courier new]result=`$CURL --interface $ETH -T $ftp_local_file -u $ftp_username:$ftp_password ftp://$ftp_ip$ftp_path$ftp_remote_file 2>&1`[/FONT][/COLOR]

[COLOR=#000000][FONT=courier new]if grep -q -o -i "curl: (67) Access denied: 530.*$" <<< "$result"; then[/FONT][/COLOR]
[COLOR=#000000][FONT=courier new]          echo "FTP access denied. Please check your login details."[/FONT][/COLOR]
[COLOR=#000000][FONT=courier new]          exit 1[/FONT][/COLOR]
[COLOR=#000000][FONT=courier new]fi[/FONT][/COLOR]
[COLOR=#000000][FONT=courier new]if grep -q -o -i "curl: (6) Couldn't resolve host.*$" <<< "$result"; then[/FONT][/COLOR]
[COLOR=#000000][FONT=courier new]          echo "Host could not be resolved. Please check your host details."[/FONT][/COLOR]
[COLOR=#000000][FONT=courier new]          exit 1[/FONT][/COLOR]
[COLOR=#000000][FONT=courier new]fi[/FONT][/COLOR]
[COLOR=#000000][FONT=courier new]if grep -q -o -i "curl: (9) Uploaded unaligned file size.*$" <<< "$result"; then[/FONT][/COLOR]
[COLOR=#000000][FONT=courier new]          echo "File could not be uploaded. Please check your path."[/FONT][/COLOR]
[COLOR=#000000][FONT=courier new]          exit 1[/FONT][/COLOR]
[COLOR=#000000][FONT=courier new]fi[/FONT][/COLOR]
[COLOR=#000000][FONT=courier new]if grep -q -o -i "curl: Can't open.*$" <<< "$result"; then[/FONT][/COLOR]
[COLOR=#000000][FONT=courier new]          echo "Can't open $ftp_local_file"[/FONT][/COLOR]
[COLOR=#000000][FONT=courier new]          exit 1[/FONT][/COLOR]
[COLOR=#000000][FONT=courier new]fi
[/FONT][/COLOR]

อย่าลืมแก้ไข interface

ดูรายละเอียดเพิ่มเติม http://help.directadmin.com/item.php?id=111

แก้ไข

  1. CentOS 5.x

ขอบคุณครับ แต่ผมยังไม่เคยเจอปัญหาเลยแหะ