Back Ups

March 07, 2015

Backup Script

To use this script:

1: Create empty file , such as /usr/local/bin/ to place the script into.

2: Copy script text below, then paste into file.

3: Configure script under the "CONFIGURE SECTION".

4: Create needed directories, such as /mnt/backups/Full.

5: Run the script in a terminal to check for errors.

    # cd /usr/local/bin


6: Set CRON to run script as needed.

7: Set up the Clean Up script to remove old backups.

#! /bin/bash
# See
# Author: Jerry Perkins, Nashville, Tennessee
# Last revision October 14, 2006
# Purpose: To make a full rsync backups on a Linux / UNIX machine.
# --------- USER NOTES ----------
# Examples:
# /usr/local/bin/
# Run every night
# at 2:05 am.
# --------- CONFIGURE SECTION ----------
# On 'STORAGE=' set path to where to backups will be
# stored.
# Example: STORAGE="/mnt/backups/Full"
# Below, edit the directories that you want included.
if [ -e $STORAGE ]
# -a - --archive
     rsync -a --delete --exclude "*bak" /boot $STORAGE
     rsync -a --delete --exclude "*bak" /etc $STORAGE
     rsync -al --delete --exclude "*bak" /home $STORAGE
     rsync -a --delete --exclude "*bak" /opt $STORAGE
     rsync -a --delete --exclude "*bak" /root $STORAGE
     rsync -a --delete --exclude "*bak" /srv $STORAGE
     rsync -a --delete --exclude "*bak" /usr/local $STORAGE/usr
     rsync -a --delete --exclude "*bak" /var $STORAGE


If you have any comments, problems, questions or suggestions, please send me an e-mail at

Updated;   This page was last updated on Mar 07 , 2015 .

Any Browser        Gates Free        Valid XHTML 1.0! Valid CSS!

Linux Logo