لینوکس و شبکه

لینوکس و شبکه
طبقه بندی موضوعی
آخرین مطالب
  • ۹۹/۱۱/۱۳
    java

۲ مطلب با کلمه‌ی کلیدی «FTP» ثبت شده است

۲۰
اسفند

  • yum install curlftpfs             [# if error: yum install fuse ]
  • $ftphost = [FTP host]
  • $mount = [Mounted to folder]
  • $user = [FTP username]
  • $pass = [FTP password]
  • curlftpfs $ftphost $mount -o user=$user:$pass,allow_other     [# Mount the CurlFtpFS]
  • fusermount -u $mount      [# Unmount the CurlFtpFS]
                          • behrooz mohamadi nsasab
                          ۰۶
                          تیر
                          روش زیر اتصا ل یک مسیر اف تی پی به یک فولدر در سروررا توضیح میدهد
                          ابتدا بسته curlftpfs  را نصب نمایید (نکته: اگر به مشکل خورد ابتدا بسته fuse را نصب نمایید)
                          vim /etc/init.d/mountftp
                          #!/bin/sh
                          #
                          # Run-level Startup script for curlftpfs
                          #
                          # chkconfig: 345 91 19
                          # description: Startup/Shutdown the curlftpfs
                           
                          # FTP user, password, and host (you can specify the port also eg. ftp.example.com:2002)
                          ftpUser=user                    #نام کاربری از اف تی پی
                          ftpPass=password                #پسورد کاربر اف تی پی
                          ftpHost=ftp.example.com         #مسیر  اف تی پی مورد نظر که باید به  فولدر متصل شود
                          mPath="/var/mounted/ftp"      #فولدر مورد نظر در سرور فعلی که قرار است مسیر اف تی پی  به آن متصل شود
                           
                          # Create the mounted to dir if doesn't exist
                          if [ ! -d $mPath ]; then
                              mkdir -p $mPath
                          fi
                           
                          case "$1" in
                              start)
                                  curlftpfs $ftpHost $mPath -o user=$ftpUser:$ftpPass,allow_other
                                  ;;
                              stop)
                                  fusermount -u $mPath      
                                  ;;
                              reload|restart)
                                  $0 stop
                                  $0 start
                                  ;;
                              *)
                                  echo "Usage: $0 start|stop|restart|reload"
                                  exit 1
                          esac
                          exit 0
                          سپس قرار دادن این اسکریپت در autostart به روش زیر:
                          chmod 755 /etc/init.d/mountftp
                          chkconfig mountftp on

                           

                          دستورات قابل اجرا :
                          # Start
                          service mountftp start
                           
                          # Restart and reload
                          service mountftp restart
                          service mountftp reload
                           
                          # Stop
                          service mountftp stop


                          لینک مفید از این مطلب:  LINK

                          • behrooz mohamadi nsasab