Difference between revisions of "Backup with rsync"

From OpenKM Documentation
Jump to: navigation, search
m (Remote backup with rsync (Tomcat - PostgreSQL))
(Remote backup with rsync (incremental with "backup-dir" + MySQL))
 
(22 intermediate revisions by 2 users not shown)
Line 2: Line 2:
  
 
rsync is a software application and network protocol for Unix, Linux and Windows systems which synchronizes files and directories from one location to another while minimizing data transfer using delta encoding when appropriate. An important feature of rsync not found in most similar programs/protocols is that the mirroring takes place with only one transmission in each direction. rsync can copy or display directory contents and copy files, optionally using compression and recursion.
 
rsync is a software application and network protocol for Unix, Linux and Windows systems which synchronizes files and directories from one location to another while minimizing data transfer using delta encoding when appropriate. An important feature of rsync not found in most similar programs/protocols is that the mirroring takes place with only one transmission in each direction. rsync can copy or display directory contents and copy files, optionally using compression and recursion.
 +
 +
{{Advice|See also [[Backup restoring]].}}
  
 
== Remote backup with rsync ==
 
== Remote backup with rsync ==
Line 49: Line 51:
 
# Start JBoss
 
# Start JBoss
 
/etc/init.d/jboss start
 
/etc/init.d/jboss start
 +
echo -e "\n### END: $(date +"%x %X") ###"
 +
</source>
 +
 +
== Remote backup with rsync (incremental with "link-dest" + MySQL) ==
 +
<source lang="bash">
 +
#!/bin/bash
 +
#
 +
## BEGIN CONFIG ##
 +
HOST=$(uname -n)
 +
MYSQL_PASS=""
 +
OPENKM_DB="okmdb"
 +
OPENKM_HOME="/home/openkm"
 +
TOMCAT_HOME="$OPENKM_HOME/tomcat-7.0.27"
 +
DATABASE_EXP="$OPENKM_HOME/db"
 +
RSYNC_OPTS="-ahR --partial --stats --delete --exclude=*~ --exclude=tomcat-7.0.27/temp/* --exclude=tomcat-7.0.27/work/* --exclude=tomcat-7.0.27/logs/* --delete-excluded"
 +
BACKUP_SRV="backup@server"
 +
BACKUP_DIR="/home/backup/$HOST"
 +
## END CONFIG ##
 +
 +
if [ $(id -u) != 0 ]; then echo "You should run this script as root"; exit; fi
 +
 +
echo -e "### BEGIN: $(date +"%x %X") ###\n"
 +
rm -rf $DATABASE_EXP
 +
mkdir -p $DATABASE_EXP
 +
 +
# Stop Tomcat
 +
/etc/init.d/tomcat stop
 +
 +
# Backup de MySQL
 +
if [ -n "$MYSQL_PASS" ]; then
 +
  echo "* Backuping MySQL data from $OPENKM_DB..."
 +
  mysqldump -h localhost -u root -p$MYSQL_PASS $OPENKM_DB > $DATABASE_EXP/mysql_$OPENKM_DB.sql
 +
fi
 +
 +
# Create missing backup folder
 +
ssh $BACKUP_SRV "mkdir -p $BACKUP_DIR"
 +
 +
# Calculate snapshot
 +
LAST_SNAPSHOT=`ssh $BACKUP_SRV "cd $BACKUP_DIR && stat --format='%n' * | tail -1"`
 +
NEW_SNAPSHOT=`date +%Y-%m-%d`
 +
echo -e "\n### RSYNC - BEGIN : $(date +"%x %X") ###\n"
 +
echo "* Last Snapshot: $LAST_SNAPSHOT"
 +
echo "* New Snapshot: $NEW_SNAPSHOT"
 +
 +
if [ ! $LAST_SNAPSHOT ]; then
 +
  rsync $RSYNC_OPTS $OPENKM_HOME/ "$BACKUP_SRV:$BACKUP_DIR/$NEW_SNAPSHOT"
 +
else
 +
  rsync $RSYNC_OPTS --link-dest="$BACKUP_DIR/$LAST_SNAPSHOT" $OPENKM_HOME/ "$BACKUP_SRV:$BACKUP_DIR/$NEW_SNAPSHOT"
 +
fi
 +
 +
# Start Tomcat
 +
/etc/init.d/tomcat start
 +
echo -e "\n### END: $(date +"%x %X") ###"
 +
</source>
 +
 +
== Remote backup with rsync (incremental with "backup-dir" + MySQL) ==
 +
<source lang="bash">
 +
#!/bin/bash
 +
#
 +
## BEGIN CONFIG ##
 +
HOST=$(uname -n)
 +
MYSQL_PASS=""
 +
OPENKM_DB="okmdb"
 +
OPENKM_HOME="/home/openkm"
 +
TOMCAT_HOME="$OPENKM_HOME/tomcat-7.0.27"
 +
DATABASE_EXP="$OPENKM_HOME/db"
 +
RSYNC_OPTS="-ahR --partial --stats --delete --exclude=*~ --exclude=tomcat-7.0.27/temp/* --exclude=tomcat-7.0.27/work/* --exclude=tomcat-7.0.27/logs/* --delete-excluded"
 +
BACKUP_SRV="backup@server"
 +
BACKUP_DIR="/home/backup/$HOST"
 +
## END CONFIG ##
 +
 +
if [ $(id -u) != 0 ]; then echo "You should run this script as root"; exit; fi
 +
 +
echo -e "### BEGIN: $(date +"%x %X") ###\n"
 +
rm -rf $DATABASE_EXP
 +
mkdir -p $DATABASE_EXP
 +
 +
# Stop Tomcat
 +
/etc/init.d/tomcat stop
 +
 +
# Backup de MySQL
 +
if [ -n "$MYSQL_PASS" ]; then
 +
  echo "* Backuping MySQL data from $OPENKM_DB..."
 +
  mysqldump -h localhost -u root -p$MYSQL_PASS $OPENKM_DB > $DATABASE_EXP/mysql_$OPENKM_DB.sql
 +
fi
 +
 +
# Calculate snapshot
 +
NEW_SNAPSHOT=`date +%Y-%m-%d`
 +
echo -e "\n### RSYNC - BEGIN : $(date +"%x %X") ###\n"
 +
echo "* New Snapshot: $NEW_SNAPSHOT"
 +
rsync $RSYNC_OPTS --backup --backup-dir="$BACKUP_DIR/INCREMENTAL/$NEW_SNAPSHOT" $OPENKM_HOME/ "$BACKUP_SRV:$BACKUP_DIR/LAST_BACKUP"
 +
 +
# Start Tomcat
 +
/etc/init.d/tomcat start
 
echo -e "\n### END: $(date +"%x %X") ###"
 
echo -e "\n### END: $(date +"%x %X") ###"
 
</source>
 
</source>
Line 59: Line 155:
 
HOST=$(uname -n)
 
HOST=$(uname -n)
 
MYSQL_PASS=""
 
MYSQL_PASS=""
 +
OPENKM_DB="okmdb"
 
OPENKM_HOME="/home/openkm"
 
OPENKM_HOME="/home/openkm"
JBOSS_HOME="$OPENKM_HOME/jboss-4.2.3.GA"
+
TOMCAT_HOME="$OPENKM_HOME/tomcat-7.0.27"
 
DATABASE_EXP="$OPENKM_HOME/db"
 
DATABASE_EXP="$OPENKM_HOME/db"
 
BACKUP_DIR="/mnt/backup"
 
BACKUP_DIR="/mnt/backup"
Line 71: Line 168:
 
mkdir -p $DATABASE_EXP
 
mkdir -p $DATABASE_EXP
  
# Stop JBoss
+
# Stop Tomcat
/etc/init.d/jboss stop
+
/etc/init.d/tomcat stop
  
 
# Clean logs
 
# Clean logs
echo "Clean JBoss temporal files."
+
#echo "Clean Tomcat temporal files."
# rm -rf $JBOSS_HOME/server/default/log
+
#rm -rf $TOMCAT_HOME/logs/*
rm -rf $JBOSS_HOME/server/default/tmp
+
#rm -rf $TOMCAT_HOME/temp/*
rm -rf $JBOSS_HOME/server/default/work
+
#rm -rf $TOMCAT_HOME/work/Catalina/localhost
rm -rf $JBOSS_HOME/server/default/data/wsdl
 
  
 
# Backup de MySQL
 
# Backup de MySQL
if [ -n "$MYSQL_PASS" ]; then
+
f [ -n "$MYSQL_PASS" ]; then
   MYSQL_DBS=$(mysqlshow -h localhost -u root -p$MYSQL_PASS | awk '(NR > 2) && (/[a-zA-Z0-9]+[ ]+[|]/) && ($2 != "mysql") && ($2 != "test") && ($2 != "information_schema") { print $2 }');
+
   echo "* Backuping MySQL data from $OPENKM_DB...";
+
  mysqldump -h localhost -u root -p$MYSQL_PASS $OPENKM_DB > $DATABASE_EXP/mysql_$OPENKM_DB.sql
  for DB in $MYSQL_DBS ; do
 
    echo "* Backuping MySQL data from $DB...";
 
    mysqldump -h localhost -u root -p$MYSQL_PASS $DB > $DATABASE_EXP/mysql_$DB.sql
 
  done
 
  echo "-------------------------------------";
 
 
fi
 
fi
  
Line 95: Line 186:
 
rsync -apzhR --stats --delete --exclude=*~ --delete-excluded $OPENKM_HOME $BACKUP_DIR/$HOST
 
rsync -apzhR --stats --delete --exclude=*~ --delete-excluded $OPENKM_HOME $BACKUP_DIR/$HOST
  
# Start JBoss
+
# Start Tomcat
/etc/init.d/jboss start
+
/etc/init.d/tomcat start
 
echo -e "\n### END: $(date +"%x %X") ###"
 
echo -e "\n### END: $(date +"%x %X") ###"
 
</source>
 
</source>
Line 120: Line 211:
 
# Copy to backup server
 
# Copy to backup server
 
rsync -apzhR --stats --delete --exclude=*~ --exclude="$JBOSS_HOME/cache" --delete-excluded \
 
rsync -apzhR --stats --delete --exclude=*~ --exclude="$JBOSS_HOME/cache" --delete-excluded \
--link-dest="$BACKUP_DIR/$HOST/backup.$LAST_SNAPSHOT" $FILES "$BACKUP_DIR/$HOST/backup.$NEW_SNAPSHOT"
+
      --link-dest="$BACKUP_DIR/$HOST/backup.$LAST_SNAPSHOT" $FILES "$BACKUP_DIR/$HOST/backup.$NEW_SNAPSHOT"
  
 
# Start JBoss
 
# Start JBoss
Line 143: Line 234:
 
HOST=$(uname -n)
 
HOST=$(uname -n)
 
RSYNC_OPTS="-ahPR --stats --delete --exclude=*~ --delete-excluded"
 
RSYNC_OPTS="-ahPR --stats --delete --exclude=*~ --delete-excluded"
 +
OPENKM_DB="okmdb"
 
OPENKM_HOME="/home/openkm"
 
OPENKM_HOME="/home/openkm"
 
TOMCAT_HOME="$OPENKM_HOME/tomcat-7.0.27"
 
TOMCAT_HOME="$OPENKM_HOME/tomcat-7.0.27"
Line 166: Line 258:
  
 
# Backup de PostgreSQL
 
# Backup de PostgreSQL
POSTGRESQL_DBS=$(su postgres -c "psql -l" | awk '(NR > 2) && (/[a-zA-Z0-9]+[ ]+[|]/) && ($1 !~ /template[0-1]/) && ($1 != "postgres") { print $1 }');
+
echo "* Backuping PostgreSQL data from $OPENKM_DB..."
 
+
su postgres -c "pg_dump -Fc -b $OPENKM_DB" > $DATABASE_EXP/pg_$OPENKM_DB.dmp
for DB in $POSTGRESQL_DBS ; do
 
  echo "* Backuping PostgreSQL data from $DB..."
 
  su postgres -c "pg_dump -Fc -b $DB" > $DATABASE_EXP/pg_$DB.dmp
 
 
done
 
done
  
Line 199: Line 288:
 
echo "=================================";
 
echo "=================================";
 
</source>
 
</source>
 +
 +
== rsync and FTP ==
 +
rsync need SSH access to work, but you can also use it with an FTP server if you mount it locally with '''curlftpfs''':
 +
 +
{{Note|Backup performance may degrade using this method.}}
 +
 +
* Install curlftpfs and rsync
 +
  $ sudo apt-get install curlftpfs rsync
 +
 +
* Create mountpoint
 +
  $ mkdir /path/to/mount
 +
 +
* Mount remote directory
 +
  $ curlftpfs ftp.example.com /path/to/mount
 +
 +
* Create local directory
 +
  $ mkdir /local/path
 +
 +
* Rsync mounted directory to local directory
 +
  $ rsync -r -t -v --progress --bwlimit=500 /path/to/mount/ /local/path/
  
 
[[Category: Installation Guide]]
 
[[Category: Installation Guide]]
[[Category: OKM Network]]
 

Latest revision as of 09:38, 14 November 2013

rsync is a software application and network protocol for Unix, Linux and Windows systems which synchronizes files and directories from one location to another while minimizing data transfer using delta encoding when appropriate. An important feature of rsync not found in most similar programs/protocols is that the mirroring takes place with only one transmission in each direction. rsync can copy or display directory contents and copy files, optionally using compression and recursion.


Nota idea.png See also Backup restoring.

Remote backup with rsync

#!/bin/bash
#
## BEGIN CONFIG ##
HOST=$(uname -n)
FILES="/home/openkm"
BACKUP_DIR="/mnt/backup"
## END CONFIG ##
echo -e "### BEGIN: $(date +"%x %X") ###\n"

# Stop JBoss
/etc/init.d/jboss stop
while [ "$(ps -ef | grep java | grep jboss | wc -l)" -gt "0" ]; do
  sleep 5; echo ".";
done

# Copy to backup server
rsync -apzhR --stats --delete --exclude=*~ --delete-excluded $FILES backup@server:$BACKUP_DIR/$HOST

# Start JBoss
/etc/init.d/jboss start
echo -e "\n### END: $(date +"%x %X") ###"

Remote backup with rsync and rotation

#!/bin/bash
#
## BEGIN CONFIG ##
HOST=$(uname -n)
FILES="/home/openkm"
BACKUP_DIR="/mnt/backup"
## END CONFIG ##
echo -e "### BEGIN: $(date +"%x %X") ###\n"

# Stop JBoss
/etc/init.d/jboss stop

# Copy to backup server
ssh backup@server "cd $HOST; rm -rf backup.3; mv backup.2 backup.3; mv backup.1 backup.2; mv backup.0 backup.1"
rsync -apzhR --stats --delete --exclude=*~ --delete-excluded --link-dest="$BACKUP_DIR/$HOST/backup.1" \
$FILES backup@server:$BACKUP_DIR/$HOST/backup.0

# Start JBoss
/etc/init.d/jboss start
echo -e "\n### END: $(date +"%x %X") ###"

Remote backup with rsync (incremental with "link-dest" + MySQL)

#!/bin/bash
#
## BEGIN CONFIG ##
HOST=$(uname -n)
MYSQL_PASS=""
OPENKM_DB="okmdb"
OPENKM_HOME="/home/openkm"
TOMCAT_HOME="$OPENKM_HOME/tomcat-7.0.27"
DATABASE_EXP="$OPENKM_HOME/db"
RSYNC_OPTS="-ahR --partial --stats --delete --exclude=*~ --exclude=tomcat-7.0.27/temp/* --exclude=tomcat-7.0.27/work/* --exclude=tomcat-7.0.27/logs/* --delete-excluded"
BACKUP_SRV="backup@server"
BACKUP_DIR="/home/backup/$HOST"
## END CONFIG ##

if [ $(id -u) != 0 ]; then echo "You should run this script as root"; exit; fi

echo -e "### BEGIN: $(date +"%x %X") ###\n"
rm -rf $DATABASE_EXP
mkdir -p $DATABASE_EXP

# Stop Tomcat
/etc/init.d/tomcat stop

# Backup de MySQL
if [ -n "$MYSQL_PASS" ]; then
  echo "* Backuping MySQL data from $OPENKM_DB..."
  mysqldump -h localhost -u root -p$MYSQL_PASS $OPENKM_DB > $DATABASE_EXP/mysql_$OPENKM_DB.sql
fi

# Create missing backup folder
ssh $BACKUP_SRV "mkdir -p $BACKUP_DIR"

# Calculate snapshot
LAST_SNAPSHOT=`ssh $BACKUP_SRV "cd $BACKUP_DIR && stat --format='%n' * | tail -1"`
NEW_SNAPSHOT=`date +%Y-%m-%d`
echo -e "\n### RSYNC - BEGIN : $(date +"%x %X") ###\n"
echo "* Last Snapshot: $LAST_SNAPSHOT"
echo "* New Snapshot: $NEW_SNAPSHOT"

if [ ! $LAST_SNAPSHOT ]; then
  rsync $RSYNC_OPTS $OPENKM_HOME/ "$BACKUP_SRV:$BACKUP_DIR/$NEW_SNAPSHOT"
else 
  rsync $RSYNC_OPTS --link-dest="$BACKUP_DIR/$LAST_SNAPSHOT" $OPENKM_HOME/ "$BACKUP_SRV:$BACKUP_DIR/$NEW_SNAPSHOT"
fi

# Start Tomcat
/etc/init.d/tomcat start
echo -e "\n### END: $(date +"%x %X") ###"

Remote backup with rsync (incremental with "backup-dir" + MySQL)

#!/bin/bash
#
## BEGIN CONFIG ##
HOST=$(uname -n)
MYSQL_PASS=""
OPENKM_DB="okmdb"
OPENKM_HOME="/home/openkm"
TOMCAT_HOME="$OPENKM_HOME/tomcat-7.0.27"
DATABASE_EXP="$OPENKM_HOME/db"
RSYNC_OPTS="-ahR --partial --stats --delete --exclude=*~ --exclude=tomcat-7.0.27/temp/* --exclude=tomcat-7.0.27/work/* --exclude=tomcat-7.0.27/logs/* --delete-excluded"
BACKUP_SRV="backup@server"
BACKUP_DIR="/home/backup/$HOST"
## END CONFIG ##

if [ $(id -u) != 0 ]; then echo "You should run this script as root"; exit; fi

echo -e "### BEGIN: $(date +"%x %X") ###\n"
rm -rf $DATABASE_EXP
mkdir -p $DATABASE_EXP

# Stop Tomcat
/etc/init.d/tomcat stop

# Backup de MySQL
if [ -n "$MYSQL_PASS" ]; then
  echo "* Backuping MySQL data from $OPENKM_DB..."
  mysqldump -h localhost -u root -p$MYSQL_PASS $OPENKM_DB > $DATABASE_EXP/mysql_$OPENKM_DB.sql
fi

# Calculate snapshot
NEW_SNAPSHOT=`date +%Y-%m-%d`
echo -e "\n### RSYNC - BEGIN : $(date +"%x %X") ###\n"
echo "* New Snapshot: $NEW_SNAPSHOT"
rsync $RSYNC_OPTS --backup --backup-dir="$BACKUP_DIR/INCREMENTAL/$NEW_SNAPSHOT" $OPENKM_HOME/ "$BACKUP_SRV:$BACKUP_DIR/LAST_BACKUP"

# Start Tomcat
/etc/init.d/tomcat start
echo -e "\n### END: $(date +"%x %X") ###"

Local backup with rsync and MySQL

#!/bin/bash
#
## BEGIN CONFIG ##
HOST=$(uname -n)
MYSQL_PASS=""
OPENKM_DB="okmdb"
OPENKM_HOME="/home/openkm"
TOMCAT_HOME="$OPENKM_HOME/tomcat-7.0.27"
DATABASE_EXP="$OPENKM_HOME/db"
BACKUP_DIR="/mnt/backup"
## END CONFIG ##

if [ $(id -u) != 0 ]; then echo "You should run this script as root"; exit; fi

echo -e "### BEGIN: $(date +"%x %X") ###\n"
rm -rf $DATABASE_EXP
mkdir -p $DATABASE_EXP

# Stop Tomcat
/etc/init.d/tomcat stop

# Clean logs
#echo "Clean Tomcat temporal files."
#rm -rf $TOMCAT_HOME/logs/*
#rm -rf $TOMCAT_HOME/temp/*
#rm -rf $TOMCAT_HOME/work/Catalina/localhost

# Backup de MySQL
f [ -n "$MYSQL_PASS" ]; then
  echo "* Backuping MySQL data from $OPENKM_DB...";
  mysqldump -h localhost -u root -p$MYSQL_PASS $OPENKM_DB > $DATABASE_EXP/mysql_$OPENKM_DB.sql
fi

# Create backup
rsync -apzhR --stats --delete --exclude=*~ --delete-excluded $OPENKM_HOME $BACKUP_DIR/$HOST

# Start Tomcat
/etc/init.d/tomcat start
echo -e "\n### END: $(date +"%x %X") ###"

Local backup with rsync and rotation

#!/bin/bash
#
## BEGIN CONFIG ##
HOST=$(uname -n)
FILES="/home/openkm"
BACKUP_DIR="/mnt/backup"
## END CONFIG ##
echo -e "### BEGIN: $(date +"%x %X") ###\n"

# Stop JBoss
/etc/init.d/jboss stop

# Calculate snapshot
LAST_SNAPSHOT=`ls -ltr $BACKUP_DIR | tail -1 | awk {'print $8'} | cut -d . -f 2`
NEW_SNAPSHOT=$((LAST_SNAPSHOT+1))

# Copy to backup server
rsync -apzhR --stats --delete --exclude=*~ --exclude="$JBOSS_HOME/cache" --delete-excluded \
      --link-dest="$BACKUP_DIR/$HOST/backup.$LAST_SNAPSHOT" $FILES "$BACKUP_DIR/$HOST/backup.$NEW_SNAPSHOT"

# Start JBoss
/etc/init.d/jboss start
echo -e "\n### END: $(date +"%x %X") ###"

# Status
echo "=================================";
du -hs $BACKUP_DIR
echo "*********************************";
du -hs --time $BACKUP_DIR/*
echo "=================================";
df -h | grep "$BACKUP_DIR"
echo "=================================";

Remote backup with rsync (Tomcat - PostgreSQL)

#!/bin/bash
#
## BEGIN CONFIG ##
HOST=$(uname -n)
RSYNC_OPTS="-ahPR --stats --delete --exclude=*~ --delete-excluded"
OPENKM_DB="okmdb"
OPENKM_HOME="/home/openkm"
TOMCAT_HOME="$OPENKM_HOME/tomcat-7.0.27"
DATABASE_EXP="$OPENKM_HOME/db"
BACKUP_SRV="user@server.com"
BACKUP_DIR="/mnt/backup"
## END CONFIG ##

if [ $(id -u) != 0 ]; then echo "You should run this script as root"; exit; fi

echo -e "### BEGIN: $(date +"%x %X") ###\n"
rm -rf $DATABASE_EXP
mkdir -p $DATABASE_EXP

# Stop Tomcat
/etc/init.d/tomcat stop

# Clean logs
#echo "Clean Tomcat temporal files."
#rm -rf $TOMCAT_HOME/logs/*
#rm -rf $TOMCAT_HOME/temp/*
#rm -rf $TOMCAT_HOME/work/Catalina/localhost

# Backup de PostgreSQL
echo "* Backuping PostgreSQL data from $OPENKM_DB..."
su postgres -c "pg_dump -Fc -b $OPENKM_DB" > $DATABASE_EXP/pg_$OPENKM_DB.dmp
done

# Databases optimizations
su postgres -c "vacuumdb -a -z" > /dev/null
su postgres -c "reindexdb -a -q" 2> /dev/null

# Calculate snapshot
NEW_SNAPSHOT=$(date "+%Y-%m-%dT%H:%M:%S")
LAST_SNAPSHOT=$(ssh $BACKUP_SRV ls -tr $BACKUP_DIR/$HOST | tail -1)

# Backup and rotate
if [ $LAST_SNAPSHOT ]; then
  echo "Incremental backup $NEW_SNAPSHOT based on $LAST_SNAPSHOT... "
  rsync $RSYNC_OPTS --link-dest="$BACKUP_DIR/$HOST/$LAST_SNAPSHOT" "$OPENKM_HOME" "$BACKUP_SRV:$BACKUP_DIR/$HOST/$NEW_SNAPSHOT"
else
  echo "Initial full backup $NEW_SNAPSHOT..."
  rsync $RSYNC_OPTS "$OPENKM_HOME" "$BACKUP_SRV:$BACKUP_DIR/$HOST/$NEW_SNAPSHOT"
fi

# Start Tomcat
/etc/init.d/tomcat start
echo -e "\n### END: $(date +"%x %X") ###"

# Status
echo "=================================";
ssh $BACKUP_SRV ls -l "$BACKUP_DIR/$HOST"
echo "=================================";

rsync and FTP

rsync need SSH access to work, but you can also use it with an FTP server if you mount it locally with curlftpfs:


Nota clasica.png Backup performance may degrade using this method.

  • Install curlftpfs and rsync
 $ sudo apt-get install curlftpfs rsync
  • Create mountpoint
 $ mkdir /path/to/mount
  • Mount remote directory
 $ curlftpfs ftp.example.com /path/to/mount
  • Create local directory
 $ mkdir /local/path
  • Rsync mounted directory to local directory
 $ rsync -r -t -v --progress --bwlimit=500 /path/to/mount/ /local/path/