+ -
当前位置:首页 → 问答吧 → FTP 文件正在使用中 报错

FTP 文件正在使用中 报错

时间:2011-07-22

来源:互联网

本帖最后由 sunnylsj 于 2011-07-22 14:05 编辑

test.sh
  1. WORK_PATH=/path1/files
  2. fillname=$1
  3. cd $WORK_PATH
  4. for loop in `ls ${fillname}*.TXT`
  5. do
  6.         echo $loop
  7.         cp $loop ${WORK_PATH}/123.txt
  8. done
  9. ftp -ivn 192.168.0.1  <<!!! >ftp.log
  10. user user user
  11. lcd $WORK_PATH
  12. cd /path2/
  13. mput ${WORK_PATH}/123.txt
  14. by
  15. !!!
复制代码
执行  test.sh  A001
会报错
123.txt: Cannot open or remove a file containing a running program.
--------------
有点混乱,这个文件在FTP什么情况下 才是一个施放的状态呢。
我的本意 是把$loop 给mput出去的。也是报这个  Cannot open or remove a file containing a running program.
然后就想cp个新文件,还是不行? 有人知道这个什么原因不?感谢

作者: sunnylsj   发布时间: 2011-07-22

AIX 系统?

Method 1
1. Execute the slibclean command. This will removes unused kernel & library memory modules
# slibclean

Method 2
1. If you encountered this error while dealing with FTP session, you need to kill the related FTP session and restart the process again.
# ps -ef | grep ftpd
# kill -9 <Process-ID>
Additional note:
We need to kill the process that locked the file.

Method 3 (Dirty way)
1. In case, you encountered the error while copying the files over AIX. You can trick the system by move the file instead of copy. But, make sure to make a backup of the file before move.

作者: rdcwayx   发布时间: 2011-07-22