Local Backup Script

Scenario: Create a Script to take backup of user Alex’s home directory to local systems /Backup directory.

echo "*** Backup Script ***"
echo
echo "*** Script started at: $(date) on $(hostname)"


# Define variables
BACKUP_src="/home/alex"
BACKUP_dst="/Backup"
NOW=$(date +"%d-%m-%Y")

#
echo "*** Backing up Alex home directory to $BACKUP_dst/$NOW..."
/bin/cp -var $BACKUP_src $BACKUP_dst/$NOW


# Backup confirmation message ...
echo
echo "*** Backup has been taken at $BACKUP_dst"

You can leave a response, or trackback from your own site.

Leave a Reply