Automated Remote Server Backups

Your Server Should Be Backed Up In A Different Geographic Location

Backup

If your website or server is backed up in the same datacenter and a natural disaster or fire occurs, your backup may be lost. Many organizations require that websites and servers are backed up in one or more remote geographic locations.

Some organizations purposefully select datacenters that are in a remote location and backup their websites and servers in their office facility. One method to accomplish this is to create an automated script (i.e. cron job) on the server that performs the functions outlined below.

Remote Linux Server to Local Windows PC Backup Steps

  1. Create a server script to backup the entire server (excluding folders such as ‘/proc’, ‘/tmp’, and any backup folders of the server) as a ‘.tar.gz’ file using the Linux ‘tar’ command. In many cases ‘gzip’ will compress a file by a factor of 4 or 5.
  2. For convenience, create a server script to backup all databases. For MySQL, the ‘mysqldump’ command with the option ‘–all-databases’ can be used with ‘gzip’ to create a ‘.sql.gz’ file.
  3. Normally the server script should delete old backups in order to manage server diskspace.
  4. Using a Linux program such as ‘lftp’, connect to the designated computer in the office. This typically requires the office router to map the incoming FTP request to a subnet IP address. FileZilla Server can be installed on a Windows computer for this purpose. This connection can be secured with SSL using ‘lftp’ on the Linux server and FileZilla Server on a Windows PC.
  5. If your office has a ‘dynamic’ IP address (i.e. the IP address can change from time to time and is not ‘static’), you can use a service such as ‘DynDNS Pro’ to establish a domain name for your office IP address.
  6. Normally the ‘lftp’ script should delete old backups in order to manage the office computer diskspace.
  7. Copy the newly created ‘.tar.gz’ and ‘.sql.gz’ files from the server to the office computer using the ‘lftp’ script.

Now you can have peace of mind knowing that your important website and server files have been regularly backed up on a computer in your office in addition to a remote datacenter.

OTTStreamingVideo.net is expert at writing complex Linux scripts for backup, security, and other applications. Please contact us for more information.

Comments are closed.