What is the most effective Linux backup method for a residence web server?

I presently support my Fedora Linux web server making use of rsync and also a neighborhood USB drive. Until now this appears to match my demands, yet I believe there are far better means to deal with this. Far back I made use of to make use of tape, yet tape backup of dimension to support my web server is currently valued escape of my rate array. Something automated would certainly be much better. Although I intend I can automate my existing rsync backup, this would certainly suggest leaving the USB drive on regularly.

Ideas?

0
2019-05-04 15:07:33
Source Share
Answers: 6

I make use of rsnapshot which makes use of rsync and also does incremental/full back-ups actually well.

I created a covering manuscript that I range from a cron work to place the disk, run rsnapshot, after that umount the disk, so it is not placed regularly.

Below are the manuscripts I make use of. The first is/ usr/local/sbin/ backup.sh, which primarily is a wrapper around the manuscript that does the actual job, records its result and also exit standing, and afterwards e-mails the outcomes to origin:

#!/bin/sh
#
# Run the dobackup script, capturing the output and then mail it to the
# backup alias person with the right subject line.
#

BACKUP_TYPE=daily
if [ "a$1" != "a" ] ; then
  BACKUP_TYPE=$1
fi

/usr/local/sbin/dobackup.sh ${BACKUP_TYPE} < /dev/null > /tmp/backup.txt 2>&1
RET=$?

SUBJECT="${BACKUP_TYPE} backup for $(hostname) (ERRORS)"
if [ "a$RET" = "a0" ] ; then
  SUBJECT="${BACKUP_TYPE} backup for $(hostname) (successful)"
elif [ "a$RET" = "a2" ] ; then
  SUBJECT="${BACKUP_TYPE} backup for $(hostname) (WARNINGS)"
fi

mail -s "$SUBJECT" root < /tmp/backup.txt

exit $RET

And below is/ usr/local/sbin/ dobackup.sh, which is the actual workhorse:

#!/bin/sh
#
# Perform the backup, returning the following return codes:
#
# 0 - backup successful
# 1 - errors
# 2 - backup successful, but with warnings.
#

if [ -e /dev/sdb1 ] ; then
  BACKUP_DEV=/dev/sdb1
else
  echo "No backup device available."
  echo "CANNOT CONTINUE WITH BACKUP."
  exit 1
fi

BACKUP_DIR=/mnt/backup
BACKUP_TYPE=daily

if [ "a$1" != "a" ] ; then
  BACKUP_TYPE=$1
fi

echo "Performing ${BACKUP_TYPE} backup."

umount $BACKUP_DEV 2> /dev/null
mount $BACKUP_DEV $BACKUP_DIR
if [ "a$?" != "a0" ] ; then
  echo "Error occurred trying to mount the external drive with the following command:"
  echo "  mount $BACKUP_DEV $BACKUP_DIR"
  echo "CANNOT CONTINUE WITH BACKUP."
  exit 1
fi

date

rsnapshot $BACKUP_TYPE
RET=$?

date

if [ "a$RET" = "a0" ] ; then
  echo "Snapshot performed successfully."
elif [ "a$RET" = "a2" ] ; then
  echo "Snapshot performed, but with warnings."
else
  echo "Snapshot had errors (returned ${RET})."
fi

umount $BACKUP_DIR
if [ "a$?" != "a0" ] ; then
  echo "Error occurred trying to unmount the external drive with the following command:"
  echo "  umount $BACKUP_DIR"
  exit 1
fi

exit $RET

Modify the BACKUP_DEV and also BACKUP_DIR variables to match.

0
2019-05-11 23:09:31
Source

I make use of dirvish to make backups to USB drives. I have actually numerous manuscripts constructed to place the energetic drive, I have 3, to the proper factor in the filesystem and afterwards run the backups.

Dirvish is primarily simply a perl manuscript that calls rsync with several alternatives :

  • you can have maintain several backups without throwing away room
  • you have a straightforward arrangement syntax
  • recovers are really simple
0
2019-05-08 12:38:45
Source

I backup my web server with duplicity to amazon S3. I do a complete backup every quarter and also incrementals every night. Functions fairly well.

0
2019-05-08 02:31:07
Source

The remedy I utilize it to locate a close friend that does not mind organizing a tiny fanless web server at their residence. I after that have a computerized rsync manuscript that runs over evening to sync my information to a remote area.

0
2019-05-08 02:22:43
Source

Most of the solutions in this question additionally use below. A lot of the devices stated will certainly function great on linux.

0
2019-05-08 02:07:35
Source

Take an appearance at rdiff-backup. Leaving on the USB drive can not injure. Atleast it's cost-effective. They do not make use of a great deal of power when they idle.

0
2019-05-08 02:05:37
Source