Diventa Rivenditore


Costruisci e Vendi App

Con Il Tuo Logo

Mount remote FTP server as folder on Linux and auto startup it

Sometimes we need to mount the FTP server as a folder on Linux and automatically mount it on reboot. We used this system on a client who needed to back up to an external server. This example is for CentOS 7.

# Installing the CurlFtpFS package (need EPEL repo):
yum install curlftpfs

A few CurlFtpFS command.

# $ftphost = The FTP host
# $mount = Mounted to folder
# $user = FTP username
# $pass = FTP password

# Mount the CurlFtpFS

curlftpfs $ftphost $mount -o user=$user:$pass,allow_other

# Unmount the CurlFtpFS

fusermount -u $mount

Auto mount CurlFtpFS

Creating the startup script:

vi /etc/init.d/mountftp

Copy and paste this. Change the FTP credentials and mounted to folder.

# 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)

# Mounted to folder

# Create the mounted to dir if doesn’t exist
if [ ! -d $mPath ]; then
mkdir -p $mPath

case “$1” in
curlftpfs $ftpHost $mPath -o user=$ftpUser:$ftpPass,allow_other
fusermount -u $mPath
$0 stop
$0 start
echo “Usage: $0 start|stop|restart|reload”
exit 1
exit 0

Make the startup script persistent across reboot.

# chkconfig mountftp on

Available command.

# Start
service mountftp start

# Restart and reload
service mountftp restart
service mountftp reload

# Stop
service mountftp stop

Lascia un commento

Il tuo indirizzo email non sarà pubblicato. I campi obbligatori sono contrassegnati *

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Appteam to offer you a better experience on this site uses its own and third-party technical, analytical and profiling cookies. The site also uses third-party tracking cookies to adapt advertising to your preferences.

If you want to know more or refuse consent to the use of cookies click here. By continuing to browse, you consent to the use of cookies.

Impostazioni sulla privacy salvate!
GDPR Center

When you visit a website, it can store or retrieve information on your browser, mainly in the form of cookies. Check your personal cookie services here.

These cookies are necessary for the website to function and cannot be disabled in our systems.

In order to use this website we use the following technically required cookies
  • wordpress_logged_in_
  • wordpress_sec
  • wordpress_test_cookie

We use WooCommerce as a purchasing system. 2 cookies will be stored for the shopping cart and order processing. These cookies are strictly necessary and cannot be disabled.
  • woocommerce_cart_hash
  • woocommerce_items_in_cart

  • wordpress_test_cookie
  • wordpress_logged_in_
  • wordpress_sec

Rifiuta tutti i servizi
Accetta tutti i servizi

Menu principale